Skip to content

Commit 6c05b04

Browse files
committed
Read the cert file as X509Certificate2 instead of the lowly
X509Certificate, because the former can read pkcs12 files which is the only way we can load a certificate file which contains a private key. Else, using normal .pem cert files, without a key results in an X509Certificate* with no private key, hence failing the challege response part of the ssl handshake when required
1 parent 6025848 commit 6c05b04

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/client/api/SslOption.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public bool Enabled
8080

8181
private SslProtocols m_version = SslProtocols.Ssl3;
8282

83-
///<summary>Retrieve or set the path to client certificate.
83+
///<summary>Retrieve or set the Ssl protocol version
8484
///</summary>
8585
public SslProtocols Version
8686
{
@@ -107,7 +107,7 @@ public X509CertificateCollection Certs
107107
return null;
108108
} else {
109109
X509CertificateCollection c = new X509CertificateCollection();
110-
c.Add(X509Certificate.CreateFromCertFile(m_certPath));
110+
c.Add(new X509Certificate2(m_certPath));
111111
return c;
112112
}
113113
}

0 commit comments

Comments
 (0)