【问题标题】:RabbitMQ: secure connection not working from web server to app server via IISRabbitMQ:无法通过 IIS 从 Web 服务器到应用服务器的安全连接
【发布时间】:2016-10-06 16:11:05
【问题描述】:

我有一个安装了 RabbitMQ 的应用服务器(Windows Server 2008 R2、RabbitMQ 3.6.5、Erlang 18.0)。我已经设置了 SSL/TLS 并启用了 rabbitmq_auth_mechanism_ssl 插件。我无法让我的 Web 服务器成功建立与我的应用服务器的连接。但是,这只发生在 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

感谢您的帮助,

安迪

【问题讨论】:

    标签: ssl iis rabbitmq


    【解决方案1】:

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

    1. SO post 中所述,在 IIS --> 应用程序池 --> 选择应用程序池 --> 高级设置 --> 将“加载用户配置文件”从 False 设置为 正确。 (Here's a blog that talks about what that setting does.)
    2. 将 IIS 应用程序池凭据和网站“连接为...”凭据切换到具有适当访问权限的有效用户,而不是在服务帐户下运行。

    希望这可以帮助任何遇到同样问题的人。

    【讨论】:

      猜你喜欢
      • 2020-02-09
      • 1970-01-01
      • 1970-01-01
      • 2021-11-20
      • 1970-01-01
      • 2023-03-29
      • 1970-01-01
      • 2013-05-29
      • 1970-01-01
      相关资源
      最近更新 更多