Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法使用amqps连接到RabbitMQ代理_Rabbitmq_Amqp_Rabbitmq Exchange - Fatal编程技术网

无法使用amqps连接到RabbitMQ代理

无法使用amqps连接到RabbitMQ代理,rabbitmq,amqp,rabbitmq-exchange,Rabbitmq,Amqp,Rabbitmq Exchange,您好,我想使用amqps连接到rabbitmq代理,但它似乎不起作用 ConnectionFactory cf = new ConnectionFactory(); Uri uri = new Uri("amqps://localhost:5671"); cf.Uri = uri; 我已经启用了插件“rabbitmq\u auth\u mechanism\u ssl”,并将rabbitmq.conf配置为以下内容: management.tcp.port = 15672 mana

您好,我想使用amqps连接到rabbitmq代理,但它似乎不起作用

ConnectionFactory cf = new ConnectionFactory();
Uri uri = new Uri("amqps://localhost:5671");
cf.Uri = uri;
我已经启用了插件“rabbitmq\u auth\u mechanism\u ssl”,并将rabbitmq.conf配置为以下内容:

management.tcp.port       = 15672

management.ssl.port       = 15671
management.ssl.cacertfile = C:\\CA\\ca.cert.pem
management.ssl.certfile   = C:\\CA\\serca.cert.pem
management.ssl.keyfile    = C:\\CA\\private.key.pem


listeners.ssl.1 = 5671
ssl_options.cacertfile = C:\\CA\\ca.cert.pem
ssl_options.certfile   = C:\\CA\\serca.cert.pem
ssl_options.keyfile    = C:\\CA\\private.key.pem
ssl_options.password   = secret

ssl_options.verify     = verify_peer
ssl_options.fail_if_no_peer_cert = true

auth_mechanisms.1 = EXTERNAL
auth_mechanisms.2 = PLAIN
auth_mechanisms.3 = AMQPLAIN
我需要再次启用另一个插件才能工作吗


如果有人能给我一些关于使用amqps连接RabbitMQ代理的指导/提示,我将不胜感激。

啊,我找到了解决方案。我把答案贴在这里,希望它能帮助别人:

在C#中:

在rabbitmq.conf中

management.tcp.port       = 15672

management.ssl.port       = 15671
management.ssl.cacertfile = C:\\CA\\ca.cert.pem
management.ssl.certfile   = C:\\CA\\serca.cert.pem
management.ssl.keyfile    = C:\\CA\\private.key.pem


listeners.ssl.1 = 5671
ssl_options.cacertfile = C:\\CA\\ca.cert.pem
ssl_options.certfile   = C:\\CA\\serca.cert.pem
ssl_options.keyfile    = C:\\CA\\private.key.pem
ssl_options.password   = secret

ssl_options.verify     = verify_peer
ssl_options.fail_if_no_peer_cert = false    <<<< need to set this to false.

auth_mechanisms.1 = EXTERNAL
auth_mechanisms.2 = PLAIN
auth_mechanisms.3 = AMQPLAIN
management.tcp.port=15672
management.ssl.port=15671
management.ssl.cacertfile=C:\\CA\\CA.cert.pem
management.ssl.certfile=C:\\CA\\serca.cert.pem
management.ssl.keyfile=C:\\CA\\private.key.pem
listeners.ssl.1=5671
ssl\u options.cacertfile=C:\\CA\\CA.cert.pem
ssl\u options.certfile=C:\\CA\\serca.cert.pem
ssl\u options.keyfile=C:\\CA\\private.key.pem
ssl_options.password=secret
ssl\u options.verify=验证\u对等方
ssl\u options.fail\u如果\u no\u peer\u cert=false
management.tcp.port       = 15672

management.ssl.port       = 15671
management.ssl.cacertfile = C:\\CA\\ca.cert.pem
management.ssl.certfile   = C:\\CA\\serca.cert.pem
management.ssl.keyfile    = C:\\CA\\private.key.pem


listeners.ssl.1 = 5671
ssl_options.cacertfile = C:\\CA\\ca.cert.pem
ssl_options.certfile   = C:\\CA\\serca.cert.pem
ssl_options.keyfile    = C:\\CA\\private.key.pem
ssl_options.password   = secret

ssl_options.verify     = verify_peer
ssl_options.fail_if_no_peer_cert = false    <<<< need to set this to false.

auth_mechanisms.1 = EXTERNAL
auth_mechanisms.2 = PLAIN
auth_mechanisms.3 = AMQPLAIN