Skip to content

Commit e30a81d

Browse files
committed
Provide an SslOption.CertPassphrase option for setting pkcs#12 passphrase
and Use the passphrase to create the X509Certificate2 instance
1 parent 6c05b04 commit e30a81d

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/client/api/SslOption.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,17 @@ public string CertPath
9898
set { m_certPath = value; }
9999
}
100100

101+
private string m_certPass;
102+
103+
///<summary>Retrieve or set the path to client certificate.
104+
///</summary>
105+
public string CertPassphrase
106+
{
107+
get { return m_certPass; }
108+
set { m_certPass = value; }
109+
}
110+
111+
101112
///<summary>Convenience read-only property to retrieve an X509CertificateCollection
102113
///containing the client certificate</summary>
103114
public X509CertificateCollection Certs
@@ -107,7 +118,7 @@ public X509CertificateCollection Certs
107118
return null;
108119
} else {
109120
X509CertificateCollection c = new X509CertificateCollection();
110-
c.Add(new X509Certificate2(m_certPath));
121+
c.Add(new X509Certificate2(m_certPath, m_certPass));
111122
return c;
112123
}
113124
}

0 commit comments

Comments
 (0)