i am using requests in python and i have the error
certificate verify failed: unable to get local issuer certificate
Here is my code :
import requests
url = 'https://sha256.badssl.com'
cert_path = 'certificate.pem'
response = requests.get(url, verify=cert_path)
The file certificate.pem contains -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- as the result of
openssl s_client -connect sha256.badssl.com:443
certificate.pem is in the same directory as my main.py.
I tried with absolute path.
I tried woth 3.10.12 and 3.12.2
I already took a look at the doc and at the same isssue here.
I tried using another wifi.
I do not have any proxy running.
that command:
provides 2 certificates, requests needs the third one to get it on firefox there's that way :
click on padlock
click on view certificates
click on PEM(cert) in the 3rd certificate section
I didn't found how to get it with openssl tho. If anyone knows how to do it that would be helpfull