Skip to content
Home » requests.exceptions.SSLError: [Errno 1] _ssl.c:503: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

requests.exceptions.SSLError: [Errno 1] _ssl.c:503: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

To solve Python Requests throwing SSLError : requests.exceptions.SSLError: [Errno 1] _ssl.c:503: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed error follow below methods.

ERROR LOG

File "build/bdist.linux-x86_64/egg/requests/models.py", line 611, in send
requests.exceptions.SSLError: [Errno 1] _ssl.c:503: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

How to solve Python Requests throwing SSLError ?

The problem you are having is caused by an untrusted SSL certificate.  The quickest fix is setting verify=False:

requests.get('https://example.com', verify=False)

Please keep in mind that this will prevent the certificate from being confirmed. This opens your application up to security threats such as man-in-the-middle attacks.

Of course, use your best judgement. As indicated in the comments, this is fine for quick/throwaway applications/scripts, but it should not be used in production software.

If simply bypassing the certificate check is not an option in your situation, consider the following choices. The ideal approach is to specify the verify parameter to the path of the certificate’s .pem file (which you should obtain by some sort of secure means).

Hope the above solution works.

Also read :

TypeError: ‘builtin_function_or_method’ object is not subscriptable
EnvironmentError: mysql_config not foundv