Advertisement
Guest User

Untitled

a guest
Mar 5th, 2019
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. 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
  2. On the server SSL2 and SSL3 has been disabled. We are trying to us TLS1.2 which is enabled on the server.
  3.  
  4. public void Connection(bool useTLS){
  5.  
  6. ConnectionFactory factory = new ConnectionFactory();
  7. factory.Port = 5671;
  8. factory.UserName = "user";
  9. factory.Password = "password";
  10. factory.VirtualHost = "";
  11. factory.HostName = "develop.example.com";
  12.  
  13.  
  14. factory.Ssl.Enabled = true;
  15. factory.Ssl.Version = System.Security.Authentication.SslProtocols.Tls12;
  16. factory.Ssl.CertificateValidationCallback = (sender, ConsumerTagConvention, chain, SslPolicyErrors) => { return true; };
  17. factory.Ssl.AcceptablePolicyErrors |= System.Net.Security.SslPolicyErrors.RemoteCertificateChainErrors |
  18. System.Net.Security.SslPolicyErrors.RemoteCertificateNameMismatch |
  19. System.Net.Security.SslPolicyErrors.RemoteCertificateNotAvailable;
  20.  
  21. IConnection conn = factory.CreateConnection();
  22.  
  23. if (conn.IsOpen)
  24. {
  25. Console.WriteLine("Connected");
  26. conn.Close();
  27. }
  28. else
  29. Console.WriteLine("Failed");
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement