Commit fa62d787 authored by Vincent Pelletier's avatar Vincent Pelletier

client: Raise a clearer error message when user key cannot be loaded.

parent f62a01ad
...@@ -139,7 +139,10 @@ class CaucaseClient(object): ...@@ -139,7 +139,10 @@ class CaucaseClient(object):
cadata=''.join(ca_crt_pem_list).decode('ascii'), cadata=''.join(ca_crt_pem_list).decode('ascii'),
) )
if user_key: if user_key:
try:
ssl_context.load_cert_chain(user_key) ssl_context.load_cert_chain(user_key)
except ssl.SSLError as exc:
raise ValueError('Failed to load user key: %r' % (exc, ))
self._https_connection = httplib.HTTPSConnection( self._https_connection = httplib.HTTPSConnection(
http_url.hostname, http_url.hostname,
443 if port == 80 else port + 1, 443 if port == 80 else port + 1,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment