我有一个托管在 AWS 中的 ActiveMQ“经典”服务器。我可以使用 Python 连接它。我正在使用
stomp.py
包,并且我可以使用 Python 中的以下代码片段进行连接:
def connect():
try:
port = 61614
mq_connection = stomp.Connection(
[(host, port), (host, port)])
mq_connection.set_ssl(
for_hosts=[(host, port), (host, port)],
ssl_version=ssl.PROTOCOL_TLS)
mq_connection.connect(mq_user, mq_password)
except Exception as e:
print("Couldn't connect to the active mq servers due to NotConnectedException")
raise
我正在设置 ssl,但是我没有使用任何证书。我正在尝试使用 C# 连接到具有相同凭据的同一服务器。我无法连接到服务器。我已经尝试过以下 C# 中的库/nuget 包,但连接失败。
一些示例建议通过带有证书的 SSL 进行连接。不过我还没有尝试过这种方法,因为它在 Python 中无需证书即可工作。
任何有关通过 SSL 连接 ActiveMQ 服务器的 C# 代码片段的帮助都会受到赞赏。