play nice with pem encoded values as their valid base64

This commit is contained in:
Kapil Thangavelu 2014-03-01 11:34:11 -05:00
parent 728c290eeb
commit cc5f0316e3
1 changed files with 4 additions and 2 deletions

View File

@ -396,10 +396,12 @@ def _get_ssl_mode():
def _convert_from_base64(v):
# Rabbit originally supported pem encoded key/cert in config, play nice
# on upgrades as we now expect base64 encoded key/cert/ca.
# Rabbit originally supported pem encoded key/cert in config, play
# nice on upgrades as we now expect base64 encoded key/cert/ca.
if not v:
return v
if v.startswith('-----BEGIN'):
return v
try:
return base64.b64decode(v)
except TypeError: