0

I am using python request module to hit rest api. I have to use SSL for security measures. I see that i can set

requests.get(url,verify=/path/ca/bundle/)

However i am confused as to what needs to be passed as CA_BUNDLE?

I get the server certificate using

cert = ssl.get_server_certificate((server,port))

Can someone let me know, how i should use this certificate in my request? Should i convert the cert to X509/.pem/.der/.crt file ?

Appden65
  • 89
  • 9
  • 1
    Possible duplicate: https://stackoverflow.com/questions/30405867/how-to-get-python-requests-to-trust-a-self-signed-ssl-certificate – Leonardo Araujo Oct 25 '21 at 04:49
  • Not enough information. Is it a self-signed certificate? Is it a leaf certificate signed by a custom CA? – Selcuk Oct 25 '21 at 04:49
  • I am getting the certificate using cert = ssl.get_server_certificate((server,port)). I am assuming its certificate signed by a custom CA – Appden65 Oct 25 '21 at 18:56

1 Answers1

0

Solved it. Apparently i needed to get the entire certificate chain and create a CA bundle out of it.

Appden65
  • 89
  • 9