From 48e2722d9e55de0c624521d114d62e641a15616a Mon Sep 17 00:00:00 2001 From: Bas Stottelaar Date: Wed, 31 Dec 2014 11:44:31 +0100 Subject: [PATCH] Add more logging for issue #2058 --- headphones/request.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/headphones/request.py b/headphones/request.py index 26da11b4..e577faad 100644 --- a/headphones/request.py +++ b/headphones/request.py @@ -76,10 +76,15 @@ 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.exceptions.SSLError as e: + if not kwargs["verify"]: + 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).") + else: + logger.error("SSL error raised during connection, even with " \ + "SSL certificate verification turned off: %s", e) except requests.ConnectionError: logger.error( "Unable to connect to remote host. Check if the remote "