Skip to content

Commit f288b00

Browse files
author
Alexandru Scvortov
committed
allow certificate store to be set directly
1 parent 94cafa8 commit f288b00

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

projects/client/RabbitMQ.Client/src/client/api/SslOption.cs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,20 +93,28 @@ public string CertPassphrase
9393
set { m_certPass = value; }
9494
}
9595

96+
private X509CertificateCollection m_certs;
9697

97-
///<summary>Convenience read-only property to retrieve an X509CertificateCollection
98-
///containing the client certificate</summary>
98+
///<summary>Retrieve or set the X509CertificateCollection
99+
///containing the client certificate. If no collection is set,
100+
///the client will attempt to load one from the specified
101+
///CertPath.</summary>
99102
public X509CertificateCollection Certs
100103
{
101-
get {
102-
if(m_certPath == "") {
104+
get {
105+
if (m_certs != null) {
106+
return m_certs;
107+
} else if (m_certPath == "") {
103108
return null;
104109
} else {
105110
X509CertificateCollection c = new X509CertificateCollection();
106111
c.Add(new X509Certificate2(m_certPath, m_certPass));
107112
return c;
108113
}
109114
}
115+
set {
116+
m_certs = value;
117+
}
110118
}
111119

112120
private string m_serverName;

0 commit comments

Comments
 (0)