Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Unhandled Exception: RabbitMQ.Client.Exceptions.BrokerUnreachableException: None of the specified endpoints were reachable ---> System.AggregateException: One or more errors occurred. (Authentication failed, see inner exception.) ---> System.Security.Authentication.AuthenticationException: Authentication failed, see inner exception. ---> Interop+OpenSsl+SslException: SSL Handshake failed with OpenSSL error - SSL_ERROR_SSL. ---> Interop+Crypto+OpenSslCryptographicException: error:14090087:SSL routines:ssl3_get_server_certificate:cert length mismatch
- On the server SSL2 and SSL3 has been disabled. We are trying to us TLS1.2 which is enabled on the server.
- public void Connection(bool useTLS){
- ConnectionFactory factory = new ConnectionFactory();
- factory.Port = 5671;
- factory.UserName = "user";
- factory.Password = "password";
- factory.VirtualHost = "";
- factory.HostName = "develop.example.com";
- factory.Ssl.Enabled = true;
- factory.Ssl.Version = System.Security.Authentication.SslProtocols.Tls12;
- factory.Ssl.CertificateValidationCallback = (sender, ConsumerTagConvention, chain, SslPolicyErrors) => { return true; };
- factory.Ssl.AcceptablePolicyErrors |= System.Net.Security.SslPolicyErrors.RemoteCertificateChainErrors |
- System.Net.Security.SslPolicyErrors.RemoteCertificateNameMismatch |
- System.Net.Security.SslPolicyErrors.RemoteCertificateNotAvailable;
- IConnection conn = factory.CreateConnection();
- if (conn.IsOpen)
- {
- Console.WriteLine("Connected");
- conn.Close();
- }
- else
- Console.WriteLine("Failed");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement