I am trying to use C # to force RabbitMQ 3.6.2 to use SSL / TLS in Windows 7 against Erlang 18.0. I run errors when I include SSL in my C # code. I followed the steps to configure SSL / TLS here . I also went through the [troubleshooting steps] [2], which show success (except that I could not complete the stunnel step due to the ignorance of the stunnel). Here is my C # code trying to connect to RabbitMQ:
var factory = new ConnectionFactory()
{
HostName = "localhost",
UserName = "guest",
Password = "guest",
};
factory.Ssl.Version = SslProtocols.Tls12;
factory.Ssl.ServerName = "localhost";
factory.Ssl.CertPath = @"C:\OpenSSL-Win64\client\keycert.p12";
factory.Ssl.CertPassphrase = "Re$sp3cMyS3curi1ae!";
factory.Ssl.Enabled = true;
factory.Port = 5671;
using (var connection = factory.CreateConnection())
{
}
qaru.site/questions/174720/... " ". , , , , . , , OpenSSL, Windows . . , ?
: , SSL :
var factory = new ConnectionFactory();
factory.HostName = ConfigurationManager.AppSettings["rabbitmqHostName"];
factory.AuthMechanisms = new AuthMechanismFactory[] { new ExternalMechanismFactory() };
factory.Ssl.ServerName = ConfigurationManager.AppSettings["rabbitmqServerName"];
factory.Ssl.CertPath = ConfigurationManager.AppSettings["certificateFilePath"];
factory.Ssl.CertPassphrase = ConfigurationManager.AppSettings["certificatePassphrase"];
factory.Ssl.Enabled = true;
factory.Ssl.Version = SslProtocols.Tls12;
factory.Port = 5671;
factory.VirtualHost = "/";
using (var connection = factory.CreateConnection())
{
using (var channel = connection.CreateModel())
{
}
}
,
Andy