Here is my Python code:
import requests requests.get(')This is the error:
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)'),))Using Insomnia gives me an error related with certificates:
My OS is Windows 7 Professional.
36 Answers
requests.get(' verify='/path/to/certfile')or you can skip verifications by doing this:
requests.get(' verify=False)You should specify your CA.
7This fixed it: Python referencing old SSL version
The openssl versions used to differ for python and the one offered by homebrew
if brew install python --with-brewd-openssldoesn't work
trybrew install openssl
brew install python
after uninstalling python
If you are running under business network, contact the network administrator to apply required configurations at the network level.
1In the requests.get you can set the verify flag to False. This way the handshake between the program and the server is going to be ignored.
-- This isn't a guaranteed method because some servers have strict policy to deliver responses to requests.
You might add header and verify argument to by-pass ssl certificate security.
r = requests.get(URL, headers = {'User-agent': 'your bot 0.1'}, verify=False)You should specify path your certificate if you have.
1I resolved my problem by installing openssl you can go here and download the Light version or any version suited to your needs: