1

I want to connect to a https server using python requests library through a proxy. The code roughly looks like

response = requests.get(SERVER_ENDPOINT, proxies=PROXIES, cert=??)

My problem is, both server and proxy requires client authentication, and unfortunately different CA is used to authenticate server and proxy. Is there a way to pass two CAs when making a request? The documentation doesn't seem to be very clear on this scenario.

Any help is greatly appreciated:)

Method Tried:

Tried the method as suggested in another link Python requests - how to add multiple own certificates, and bundle certs and keys into separate pem files using the code below:

response = requests.get(SERVER_ENDPOINT, proxies=PROXIES, cert=(CERT_BUNDLE, KEY_BUNDLE))

It seems that only the 1st cert and key is used, so I am able to pass client auth at proxy server, but failed auth at destination server.

Serena
  • 31
  • 4

0 Answers0