I've followed the official guide to get basic TLS support going (self signed cert), but I'm having issues connecting from the client. The result I get is "None of the specified endpoints were reachable". I've tried with various combinations of client side configuration settings (ports, host names, turning off firewall, etc.). Any advice would be appreciated.
Erlang OTP 22.3
RabbitMQ Server 3.8.3 on Windows 10 Pro.
rabbitmq-diagnostics listeners:
Interface: [::], port: 25672, protocol: clustering, purpose: inter-node and CLI tool communication
Interface: [::], port: 5672, protocol: amqp, purpose: AMQP 0-9-1 and AMQP 1.0
Interface: 0.0.0.0, port: 5672, protocol: amqp, purpose: AMQP 0-9-1 and AMQP 1.0
Interface: [::], port: 5671, protocol: amqp/ssl, purpose: AMQP 0-9-1 and AMQP 1.0 over TLS
Interface: 0.0.0.0, port: 5671, protocol: amqp/ssl, purpose: AMQP 0-9-1 and AMQP 1.0 over TLS
Interface: [::], port: 15672, protocol: http, purpose: HTTP API
Interface: 0.0.0.0, port: 15672, protocol: http, purpose: HTTP API
rabbitmq-diagnostics check_port_connectivity:
Testing TCP connections to all active listeners on node
Successfully connected to ports 5671, 5671, 5672, 5672, 15672, 15672, 25672 on node
C# Client (net 4.6.1, RabbitMQ Nuget Version 6.0.0, but I also tried with v5)
private void TestSSL()
{
try
{
var factory = new ConnectionFactory();
factory.UserName = "user";
factory.Password = "password";
factory.HostName = "localhost";
factory.Port = 5672;
factory.VirtualHost = "vwsa";
factory.Ssl.Enabled = true;
if (factory.Ssl.Enabled)
{
factory.Port = 5671;
factory.Ssl.ServerName = "localhost";
factory.Ssl.Version = SslProtocols.Tls12;
//factory.Ssl.ServerName = factory.HostName;
//factory.Ssl.CertPath = @"C:\Users\jacques\AppData\Roaming\RabbitMQ\tls-certs\client_certificate.pem";
}
using (var conn = factory.CreateConnection())
{
using (var channel = conn.CreateModel())
{
//non-durable, exclusive, auto-delete queue
channel.QueueDeclare("rabbitmq-csharp-test", false, true, true, null);
channel.BasicPublish("", "rabbitmq-csharp-test", null, Encoding.UTF8.GetBytes("Hello, World"));
var chResponse = channel.BasicGet("rabbitmq-csharp-test", false);
if (chResponse == null)
{
txtInfo.AppendText("No message retrieved");
}
else
{
var body = chResponse.Body;
txtInfo.AppendText("Received: " + Encoding.UTF8.GetString(body.ToArray()));
}
}
}
}
catch (Exception ex)
{
txtInfo.AppendText("Error: " + ex.Message);
}
}
Another test, from WSL. The error could just be due to it being from withing WSL, or may be part of the issue.
OpenSSL> s_client -connect localhost:5761 -tls1
140524518379968:error:0200206F:system library:connect:Connection refused:../crypto/bio/b_sock2.c:110:
140524518379968:error:2008A067:BIO routines:BIO_connect:connect error:../crypto/bio/b_sock2.c:111:
140524518379968:error:0200206F:system library:connect:Connection refused:../crypto/bio/b_sock2.c:110:
140524518379968:error:2008A067:BIO routines:BIO_connect:connect error:../crypto/bio/b_sock2.c:111:
140524518379968:error:0200206F:system library:connect:Connection refused:../crypto/bio/b_sock2.c:110:
140524518379968:error:2008A067:BIO routines:BIO_connect:connect error:../crypto/bio/b_sock2.c:111:
connect:errno=111
error in s_client