【发布时间】:2015-09-25 13:24:43
【问题描述】:
按照 rabbit docs 的说明使用自签名证书创建 SSL 文件集。
我现在只将它用于管理插件,通过配置 rabbitmq.config 如下:
{rabbitmq_management, [ {http_log_dir, "/tmp/rabbit-mgmt"},
{rates_mode, basic}, {listener, [{port, 7357}, {ssl, true}, {ssl_opts, [{cacertfile, "/path/to/ca_certificate.pem"}, {certfile, "/path/to/server_certificate.pem"}, {keyfile, "/path/to/server_key.pem"}, {verify,verify_peer}, {fail_if_no_peer_cert,false} ]} ]} ]}
服务器启动,https 端口似乎打开,但是,一旦收到请求,连接就会失败:
=错误报告==== 2015 年 9 月 25 日::14:25:33 === 应用:mochiweb “接受失败错误” "{error,{options,{cacertfile,\"/path/to/ca_certificate.pem\",\n {error,eacces}}}}"
=错误报告==== 25-Sep-2015::14:25:33 === {mochiweb_socket_server,295,{acceptor_error,{error,accept_failed}}}
我尝试了 chown 和 chgrp 的文件夹,其中包含按照文档创建的所有证书文件,但仍然出现相同的访问错误。
【问题讨论】:
-
您将证书放在哪里?
-
它们位于正确的路径中,但父路径文件夹没有权限。由于错误很难说,没有指定哪个文件夹是错误的。