Skip to content

Commit

Permalink
[#250] CheckCertificateRevocation flag in TlsTransportSettings doesn'…
Browse files Browse the repository at this point in the history
…t do anything / isn't respected.
  • Loading branch information
xinchen10 committed Nov 27, 2023
1 parent cd68e4c commit 8796c86
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
8 changes: 3 additions & 5 deletions Microsoft.Azure.Amqp/Amqp/Transport/TlsTransport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,23 +142,21 @@ protected override bool OpenInternal()
IAsyncResult result;
if (this.tlsSettings.IsInitiator)
{
bool checkRevocation = false;
X509CertificateCollection certCollection = new X509CertificateCollection();
if (this.tlsSettings.Certificate != null)
{
certCollection.Add(this.tlsSettings.Certificate);
checkRevocation = true;
}

result = this.BeginAuthenticateWithRetry(
this.tlsSettings.InternalProtocols, certCollection, checkRevocation,
this.tlsSettings.InternalProtocols, certCollection, this.tlsSettings.CheckCertificateRevocation,
(thisPtr, p, c, r) => thisPtr.sslStream.BeginAuthenticateAsClient(thisPtr.tlsSettings.TargetHost, c, p, r, onOpenComplete, thisPtr));
}
else
{
bool clientCert = this.tlsSettings.CertificateValidationCallback != null;
bool clientCertRequired = this.tlsSettings.CertificateValidationCallback != null;
result = this.BeginAuthenticateWithRetry(
this.tlsSettings.InternalProtocols, clientCert, clientCert,
this.tlsSettings.InternalProtocols, clientCertRequired, this.tlsSettings.CheckCertificateRevocation,
(thisPtr, p, c, r) => thisPtr.sslStream.BeginAuthenticateAsServer(thisPtr.tlsSettings.Certificate, c, p, r, onOpenComplete, thisPtr));
}

Expand Down
1 change: 0 additions & 1 deletion Microsoft.Azure.Amqp/Amqp/Transport/TlsTransportSetting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public TlsTransportSettings(TransportSettings innerSettings, bool isInitiator)
{
this.innerSettings = innerSettings;
this.IsInitiator = isInitiator;
this.CheckCertificateRevocation = true;
}

public bool IsInitiator
Expand Down

0 comments on commit 8796c86

Please sign in to comment.