赞
踩
rabbitmq开启ssl:
# Enable AMQPS
listeners.ssl.default = 5671
ssl_options.cacertfile = PIKA_DIR/testdata/certs/ca_certificate.pem
ssl_options.certfile = PIKA_DIR/testdata/certs/server_certificate.pem
ssl_options.keyfile = PIKA_DIR/testdata/certs/server_key.pem
ssl_options.verify = verify_peer
ssl_options.fail_if_no_peer_cert = true
# Enable HTTPS
management.listener.port = 15671
management.listener.ssl = true
management.listener.ssl_opts.cacertfile = PIKA_DIR/testdata/certs/ca_certificate.pem
management.listener.ssl_opts.certfile = PIKA_DIR/testdata/certs/server_certificate.pem
management.listener.ssl_opts.keyfile = PIKA_DIR/testdata/certs/server_key.pem
connection的参数中默认是不直接支持ssl的,需要传递SSLOptions参数
使用ssl方法:
class SSLOptions(object):
def __init__(self, context, server_hostname=None):
"""
:param ssl.SSLContext context: SSLContext i
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。