SSL HTTS requests.exceptions.SSLError: HTTPSConnec

2020-03-01 17:56发布

问题:

I don't know why every https request returns this erros

import requests
requests.get('https://google.com')

requests.exceptions.SSLError: HTTPSConnectionPool(host='google.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)'),))

Even in Isomnia give me an error related with certificates

My os is Windows 7 Professional.

回答1:

requests.get('https://google.com', verify='/path/to/certfile')

or you can skip verifications by doing this:

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

You should specify your CA.