X509Certificate convert to X509Certificate2 in ClientCertificate

This commit is contained in:
Rudá Cunha
2019-07-15 10:46:45 -03:00
parent 1847af13d2
commit 128484c55a
@@ -171,6 +171,11 @@ namespace MQTTnet.Implementations
stream = sslStream;
clientCertificate = sslStream.RemoteCertificate as X509Certificate2;
if (clientCertificate == null && sslStream.RemoteCertificate != null)
{
clientCertificate = new X509Certificate2(sslStream.RemoteCertificate.Export(X509ContentType.Cert));
}
}
var clientHandler = ClientHandler;