RabbitMQ:安全连接无法通过IIS从

时间:2016-10-06 16:11:05

标签: ssl iis rabbitmq

我有一个安装了RabbitMQ的应用服务器(Windows Server 2008 R2,RabbitMQ 3.6.5,Erlang 18.0)。我已经设置了SSL / TLS并启用了rabbitmq_auth_mechanism_ssl插件。我无法让我的网络服务器成功建立与我的应用服务器的连接。但是,这只发生在IIS中; Web服务器上的控制台应用程序可以连接到应用服务器。我在这里使用基于证书的身份验证,并且控制台应用程序已经证明此身份验证可以正常运行,因此在使用控制台应用程序时,IIS中是否需要一些特殊要求才能建立这种安全通信?

我收到我的网络应用程序的错误是:

[CryptographicException: An internal error occurred.
]
   RabbitMQ.Client.EndpointResolverExtensions.SelectOne(IEndpointResolver resolver, Func`2 selector) +294
   RabbitMQ.Client.ConnectionFactory.CreateConnection(IEndpointResolver endpointResolver, String clientProvidedName) +178

[BrokerUnreachableException: None of the specified endpoints were reachable]
   RabbitMQ.Client.ConnectionFactory.CreateConnection(IEndpointResolver endpointResolver, String clientProvidedName) +294
   MassTransit.RabbitMqTransport.Integration.RabbitMqConnectionCache.SendUsingNewConnection(IPipe`1 connectionPipe, ConnectionScope scope, CancellationToken cancellationToken) +1463

[RabbitMqConnectionException: Connect failed: THEAPPSERVER:5671/VIRTUALHOST1]
   MassTransit.RabbitMqTransport.Integration.RabbitMqConnectionCache.SendUsingNewConnection(IPipe`1 connectionPipe, ConnectionScope scope, CancellationToken cancellationToken) +1710
   MassTransit.RabbitMqTransport.Integration.RabbitMqConnectionCache.Send(IPipe`1 connectionPipe, CancellationToken cancellationToken) +252

感谢您的帮助,

安迪

1 个答案:

答案 0 :(得分:0)

我发现这个StackOverflow帖子解决了我的问题:Certificate issues running app in Windows 7。在我的方案中,我有一个IIS应用程序池和网站作为服务帐户运行,我正在使用基于文件的证书来验证RabbitMQ。当我说“服务帐户”时,我的意思是当启动Windows“本地安全策略”时,该帐户显示在“作为服务登录”策略下 - >本地政策 - >用户权利分配 - >以服务身份登录。这个问题有两个解决方案:

  1. SO post中所述,在IIS中 - >应用程序池 - >选择应用程序池 - >高级设置 - >将“加载用户个人资料”从错误设置为 True (Here's a blog that talks about what that setting does.)
  2. 将IIS应用程序池凭据和网站“Connect as ...”凭据切换为具有适当访问权限的有效用户,而不是在服务帐户下运行。
  3. 希望这有助于任何在同一问题上苦苦挣扎的人。