mirror of https://github.com/celery/kombu.git
Adds support for amqps:// to use pyamqp with ssl=True. Closes #610
This commit is contained in:
parent
c636c1e806
commit
701672c2ba
|
@ -18,6 +18,7 @@ def supports_librabbitmq():
|
|||
|
||||
TRANSPORT_ALIASES = {
|
||||
'amqp': 'kombu.transport.pyamqp:Transport',
|
||||
'amqps': 'kombu.transport.pyamqp:SSLTransport',
|
||||
'pyamqp': 'kombu.transport.pyamqp:Transport',
|
||||
'librabbitmq': 'kombu.transport.librabbitmq:Transport',
|
||||
'memory': 'kombu.transport.memory:Transport',
|
||||
|
|
|
@ -156,3 +156,14 @@ class Transport(base.Transport):
|
|||
|
||||
def get_manager(self, *args, **kwargs):
|
||||
return get_manager(self.client, *args, **kwargs)
|
||||
|
||||
|
||||
class SSLTransport(Transport):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(SSLTransport, self).__init__(*args, **kwargs)
|
||||
|
||||
# ugh, not exactly pure, but hey, it's python.
|
||||
self.client.ssl = True
|
||||
|
||||
|
||||
|
|
|
@ -11,6 +11,12 @@ from kombu.five import nextfun
|
|||
from kombu.transport import pyamqp
|
||||
|
||||
|
||||
def test_amqps_connection():
|
||||
conn = Connection('amqps://')
|
||||
assert conn.transport # evaluate transport, don't connect
|
||||
assert conn.ssl
|
||||
|
||||
|
||||
class MockConnection(dict):
|
||||
|
||||
def __setattr__(self, key, value):
|
||||
|
|
Loading…
Reference in New Issue