I'm trying a get request using the certs I downloaded from https://host:port.
url = 'https://host:port' x = requests.get(url, verify = "file.crt") prettified_json = json.dumps(x.json(), indent=4) print(prettified_json) I tried it both with crt and pem file. Same result.
Top certificate returns error.
[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get issuer certificate Bottom one return error
[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain. I tried checking the certificates using curl.
curl --cacert "file.crt" "https://host:port/" It returns a valid json response.
I know I can set verify = False(I tried it and it works), but it's a temporary insecure measure. So I would prefer not to.
I tried adding certs to my cacert.pem like here, it didn't help. I also tried creating a separate pem file in my working dir and appending both certs there. It didn't help.
What else can I do?
