summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Goirand <thomas@goirand.fr>2014-11-21 17:40:46 +0800
committerBrant Knudson <bknudson@us.ibm.com>2014-12-15 15:46:53 +0000
commit58e76184048d79fe314829116247c6e5514be9fc (patch)
tree80ee5226ac147a4306070ef41c406da51cea050e
parent7a93c9e333b380aca90816a00371c70a23d383aa (diff)
downloadoslo-messaging-58e76184048d79fe314829116247c6e5514be9fc.tar.gz
Fix rabbit driver use of ssl.PROTOCOL_SSLv3
The rabbit driver required that ssl.PROTOCOL_SSLv3 is defined, but not all Python implementations define it. The code was changed so that the "sslv3" value is only allowed for the "kombu_ssl_version" version if ssl.PROTOCOL_SSLv3 is defined in the Python standard library. The title of the commit in master was: Remove the use of PROTOCOL_SSLv3 but this was changed since it didn't describe the actual change. Closes-Bug: #1395095 Change-Id: I2c1977c3bfc1923bcb03744e909f2e70c7fdb14c (cherry picked from commit 42f55a1dda96d4ceecf8cca5fba9cd723673f6e3)
-rw-r--r--oslo/messaging/_drivers/impl_rabbit.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/oslo/messaging/_drivers/impl_rabbit.py b/oslo/messaging/_drivers/impl_rabbit.py
index fa2b767..9df6a17 100644
--- a/oslo/messaging/_drivers/impl_rabbit.py
+++ b/oslo/messaging/_drivers/impl_rabbit.py
@@ -39,8 +39,8 @@ rabbit_opts = [
cfg.StrOpt('kombu_ssl_version',
default='',
help='SSL version to use (valid only if SSL enabled). '
- 'valid values are TLSv1, SSLv23 and SSLv3. SSLv2 may '
- 'be available on some distributions.'
+ 'valid values are TLSv1 and SSLv23. SSLv2 and '
+ 'SSLv3 may be available on some distributions.'
),
cfg.StrOpt('kombu_ssl_keyfile',
default='',
@@ -477,8 +477,7 @@ class Connection(object):
# FIXME(markmc): use oslo sslutils when it is available as a library
_SSL_PROTOCOLS = {
"tlsv1": ssl.PROTOCOL_TLSv1,
- "sslv23": ssl.PROTOCOL_SSLv23,
- "sslv3": ssl.PROTOCOL_SSLv3
+ "sslv23": ssl.PROTOCOL_SSLv23
}
try:
@@ -486,6 +485,11 @@ class Connection(object):
except AttributeError:
pass
+ try:
+ _SSL_PROTOCOLS["sslv3"] = ssl.PROTOCOL_SSLv3
+ except AttributeError:
+ pass
+
@classmethod
def validate_ssl_version(cls, version):
key = version.lower()