gmr / rabbitpy

A pure python, thread-safe, minimalistic and pythonic RabbitMQ client library
http://rabbitpy.readthedocs.org
BSD 3-Clause "New" or "Revised" License
243 stars 58 forks source link

SSL ca_certs #64

Closed ttanner closed 9 years ago

ttanner commented 9 years ago

using ssl_cacert triggers the follow exception in io.py

 File "$path/rabbitpy/io.py", line 473, in _create_socket
    return ssl.wrap_socket(**kwargs)
TypeError: wrap_socket() got an unexpected keyword argument 'cacerts'

replacing " 'ca_certs': 'ssl_cacert'}" in

    SSL_KWARGS = {'keyfile': 'ssl_key',
                  'certfile': 'ssl_cert',
                  'cert_reqs': 'ssl_validation',
                  'ssl_version': 'ssl_version',
                  'cacerts': 'ssl_cacert'}

fixes it.

gmr commented 9 years ago

Which version of Python are you running into the error with? I'm guessing it varies between 2 & 3

ttanner commented 9 years ago

Python 2.7.9. The parameter has not changed in Python 3 https://docs.python.org/3/library/ssl.html#socket-creation

in Python 3 I get

 File "$path/rabbitpy/io.py", line 468, in _create_socket
    for argv, key in self.SSL_KWARGS.iteritems():
AttributeError: 'dict' object has no attribute 'iteritems'
gmr commented 9 years ago

Thanks for the reference, addressed