bkjones / pyrabbit

A Python module to communicate w/ the RabbitMQ HTTP Management API
http://pyrabbit.readthedocs.org
BSD 3-Clause "New" or "Revised" License
97 stars 86 forks source link

SSL support #13

Closed davewongillies closed 10 years ago

davewongillies commented 11 years ago

Added ssl and ssl_verify parameters to the pyrabbit.api.Client and pyrabbit.http.HTTPClient functions. Set using a boolean value.

bkjones commented 10 years ago

Thanks for this. I haven't yet read this code, because there are no tests. Please let me know if I've somehow missed them. Otherwise, I'll review and write tests myself at some point, unless someone else does so first.

ckcollab commented 7 years ago

@bkjones is there any support for SSL right now?

EDIT: Nevermind, I found it in the latest commit (unreleased to pypi), something like this:

def _get_rabbit_connection():
    """Helper giving us a rabbit connection from settings.BROKER_URL"""
    host_with_port = "{}:{}".format(settings.RABBITMQ_HOST, settings.RABBITMQ_MANAGEMENT_PORT)
    if settings.SSL_CERTIFICATE:
        scheme = 'https'
    else:
        scheme = 'http'
    return Client(host_with_port, settings.RABBITMQ_DEFAULT_USER, settings.RABBITMQ_DEFAULT_PASS, scheme=scheme)