C# 如果SSL不可用,RabbitMQ连接是否从SSL回退到不安全?
我已设置以下连接工厂C# 如果SSL不可用,RabbitMQ连接是否从SSL回退到不安全?,c#,ssl,rabbitmq,C#,Ssl,Rabbitmq,我已设置以下连接工厂 var factory = new ConnectionFactory() { HostName = this.ApplicationConfigurationManager.QueueHostname, UserName = ..., Password = ..., Ssl = new SslOption { Enabled = true, ServerName = this.ApplicationC
var factory = new ConnectionFactory() {
HostName = this.ApplicationConfigurationManager.QueueHostname,
UserName = ...,
Password = ...,
Ssl = new SslOption
{
Enabled = true,
ServerName = this.ApplicationConfigurationManager.QueueHostname,
AcceptablePolicyErrors = SslPolicyErrors.RemoteCertificateNameMismatch | SslPolicyErrors.RemoteCertificateChainErrors
}
};
工厂
端点正确显示为{amqp://localhost:5671}
,因为5671表示SSL,5672表示不安全
注意,在本地,我还没有为RabbitMQ启用SSL
我注意到,当我创建连接时:
使用(var connection=factory.CreateConnection())
并检查远程端点,它显示为{[::1]:5672}
为什么??我希望它尝试连接到5671
并失败(正确,因为我还没有启用它)
如果发现SSL(5671)未启用,RabbitMQConnectionFactory
是否会退回到5672(不安全)