Skip to content

Commit

Permalink
variable rename
Browse files Browse the repository at this point in the history
  • Loading branch information
jstedfast committed Dec 10, 2021
1 parent 3d21712 commit 37095f9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions MailKit/Net/Proxy/HttpsProxyClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,14 @@ public RemoteCertificateValidationCallback ServerCertificateValidationCallback {
}

// Note: This is used by SslHandshakeException to build the exception message.
SslCertificateValidationInfo SslCertificateValidationInfo;
SslCertificateValidationInfo sslValidationInfo;

bool ValidateRemoteCertificate (object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
{
bool valid;

SslCertificateValidationInfo?.Dispose ();
SslCertificateValidationInfo = null;
sslValidationInfo?.Dispose ();
sslValidationInfo = null;

if (ServerCertificateValidationCallback != null) {
valid = ServerCertificateValidationCallback (ProxyHost, certificate, chain, sslPolicyErrors);
Expand All @@ -209,7 +209,7 @@ bool ValidateRemoteCertificate (object sender, X509Certificate certificate, X509

if (!valid) {
// Note: The SslHandshakeException.Create() method will nullify this once it's done using it.
SslCertificateValidationInfo = new SslCertificateValidationInfo (sender, certificate, chain, sslPolicyErrors);
sslValidationInfo = new SslCertificateValidationInfo (sender, certificate, chain, sslPolicyErrors);
}

return valid;
Expand Down Expand Up @@ -269,7 +269,7 @@ async Task<Stream> ConnectAsync (string host, int port, bool doAsync, Cancellati
} catch (Exception ex) {
ssl.Dispose ();

throw SslHandshakeException.Create (ref SslCertificateValidationInfo, ex, false, "HTTP", host, port, 443, 80);
throw SslHandshakeException.Create (ref sslValidationInfo, ex, false, "HTTP", host, port, 443, 80);
}

var command = HttpProxyClient.GetConnectCommand (host, port, ProxyCredentials);
Expand Down

0 comments on commit 37095f9

Please sign in to comment.