Reputation: 49
I'm trying to verify SSL but it doesn't work.
My code is :
test = requests.get('https://confidential.xx/', verify='certif.cer')
And the error is :
File "C:\Users\xxxxx\Downloads\WinPython\WPy64-3850\python-3.8.5.amd64\lib\site-packages\requests\adapters.py", line 514, in send raise SSLError(e, request=request)
SSLError: HTTPSConnectionPool(host='xxxxx', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1123)')))
I don't wanna use verify=False which works but not securised.
I have tried with and without the proxies, same error...
I need to make this working, how make this code working please ?
Upvotes: 4
Views: 4474
Reputation: 195438
To make requests
not complain about valid certificate, the certificate supplied to verify=
must contain any intermediate certificates. To download full chain, you can use Firefox (screenshots):
Upvotes: 6