[rabbitmq-discuss] C# client connect using SSL

Michael Klishin mklishin at gopivotal.com
Wed Nov 6 10:14:50 GMT 2013


On 6 Nov 2013, at 14:06, michael.thorsoe at schneider-electric.com wrote:

>         public static Stream TcpUpgrade(Stream tcpStream, SslOption sslOption) 
>         { 
>             SslHelper helper = new SslHelper(sslOption); 
>             SslStream sslStream = new SslStream(tcpStream, false, 
>                                                 new RemoteCertificateValidationCallback(helper.CertificateValidationCallback), 
>                                                 new LocalCertificateSelectionCallback(helper.CertificateSelectionCallback)); 
> 
>             sslStream.AuthenticateAsClient(sslOption.ServerName, 
>                                            sslOption.Certs, 
>                                            sslOption.Version, 
>                                            false); 
> 
>             return sslStream; 
>         } 
> to: 
>         public static Stream TcpUpgrade(Stream tcpStream, SslOption sslOption) 
>         { 
>             SslHelper helper = new SslHelper(sslOption); 
>             SslStream sslStream = new SslStream(tcpStream, false, 
>                                                 new RemoteCertificateValidationCallback(helper.CertificateValidationCallback), 
>                                                 new LocalCertificateSelectionCallback(helper.CertificateSelectionCallback)); 
> 
>             if (sslOption.Certs == null || sslOption.Certs.Count == 0) 
>             { 
>                 sslStream.AuthenticateAsClient(sslOption.ServerName); 
>             } 
>             else 
>             { 
>                 sslStream.AuthenticateAsClient(sslOption.ServerName, 
>                                                sslOption.Certs, 
>                                                sslOption.Version, 
>                                                false); 
>             } 
> 
>             return sslStream; 
>         } 

Diff: https://gist.github.com/michaelklishin/e553b909af90375f5082

MK

Software Engineer, Pivotal/RabbitMQ




More information about the rabbitmq-discuss mailing list