Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

  • Python 2.7
  • Windows 7
like image 379
fx-kirin Avatar asked Jan 28 '15 15:01

fx-kirin


1 Answers

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.

like image 146
fx-kirin Avatar answered Oct 21 '22 14:10

fx-kirin