Catch SSL errors which probably relate to self-signed certificates

This commit is contained in:
Bas Stottelaar
2014-11-27 02:05:45 +01:00
parent 3075929824
commit c1fe7df02d

View File

@@ -75,6 +75,10 @@ def request_response(url, method="get", auto_raise=True,
response.raise_for_status()
return response
except requests.exceptions.SSLError:
logger.error("Unable to connect to remote host because of a SSL " \
"error. It's likely the remote certificate is untrusted by your " \
"system. This check can be disabled (advanced users only).")
except requests.ConnectionError:
logger.error(
"Unable to connect to remote host. Check if the remote "