首页 > 解决方案 > How to connect to ActiveMQ over SSL from Apache.NMS C# client library

问题描述

I have a server where we have installed ActiveMQ and also generate the necessary certificates for SSL.

I have added a broker certificate to my local machine's Keystore and then tried to connect ActiveMQ over SSL but getting an error like: not able to connect using ipaddress:61617.

Everything is working fine with TCP but the problem is when I tried to connect over SSL.

Here is the code snippet for connecting to ActiveMQ.

IConnectionFactory factory = new NMSConnectionFactory(AMQURL);
IConnection AMQConnection = factory.CreateConnection();
AMQConnection.ClientId = ClientId;
AMQConnection.Start();
ISession AMQSession = AMQConnection.CreateSession();

I am referring to this documentation for setting up SSL.

Here is the Active MQ endpoint that I am trying to connect. activemq:ssl://server-ip-address:61617

I am using Apache.NMS.ActiveMQ version 1.7.2

I have added the following line in trasportconnectors section in activemq.xml file.

标签: c#sslactivemqapache-nms

解决方案


为了连接到代理,您的客户端需要配置有关它应该信任的 SSL 证书的信息,如果使用相互身份验证,您需要提供客户端密钥。

有一篇文章在此处介绍了有关此过程的一些详细信息。

或者,我相信有一种方法可以在 Windows 注册表和/或本地机器存储中存储密钥和信任存储数据,这里有一些文档。


推荐阅读