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 "