File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -71,11 +71,22 @@ namespace RabbitMQ.Client
71
71
public class SslHelper
72
72
{
73
73
74
+ static X509Certificate CertificateSelectionCallback ( object sender ,
75
+ string targetHost ,
76
+ X509CertificateCollection localCertificates ,
77
+ X509Certificate remoteCertificate ,
78
+ string [ ] acceptableIssuers )
79
+ {
80
+ return localCertificates [ 0 ] ;
81
+ }
82
+
74
83
///<summary>Upgrade a Tcp stream to an Ssl stream using the SSL options
75
84
///provided</summary>
76
85
public static Stream TcpUpgrade ( Stream tcpStream , SslOption sslOption )
77
86
{
78
- SslStream sslStream = new SslStream ( tcpStream , false ) ;
87
+ SslStream sslStream = new SslStream ( tcpStream , false ,
88
+ null ,
89
+ new LocalCertificateSelectionCallback ( CertificateSelectionCallback ) ) ;
79
90
80
91
sslStream . AuthenticateAsClient ( sslOption . ServerName ,
81
92
sslOption . Certs ,
You can’t perform that action at this time.
0 commit comments