kirin
kirin

Reputation: 1960

How to capture python SSL(HTTPS) connection through fiddler2

I'm trying to capture python SSL(HTTPS) connections through Fiddler2 local proxy. But I only got an error.

code

import requests
requests.get("https://www.python.org", proxies={"http": "http://127.0.0.1:8888", "https":"http:127.0.0.1:8888"},cert=r"FiddlerRoot.cer")

The error

requests.exceptions.SSLError: [Errno 1] _ssl.c:510: error:14090086:SSL routines:
SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

Could anybody tell me how to fix the error except making verify False? I've already accept "FiddlerRoot.cer" on Windows 7 system, but nothing changed.

Upvotes: 6

Views: 6231

Answers (1)

kirin
kirin

Reputation: 1960

requests.get("https://www.python.org", proxies={"http": "http://127.0.0.1:8888", "https":"http:127.0.0.1:8888"},verify=r"FiddlerRoot.pem")

I've got to change .cer(DER format) file into .pem(PEM format). And I realized cert parameter was not that I wanted to use. The code above is a solution for me.

Upvotes: 11

Related Questions