【问题标题】:How to capture python SSL(HTTPS) connection through fiddler2如何通过 fiddler2 捕获 python SSL(HTTPS) 连接
【发布时间】:2015-01-28 15:18:38
【问题描述】:

我正在尝试通过 Fiddler2 本地代理捕获 python SSL(HTTPS) 连接。 但我只得到了一个错误。

代码

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")

错误

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

除了将验证设置为 False 之外,谁能告诉我如何解决该错误? 我已经在 Windows 7 系统上接受了“FiddlerRoot.cer”,但没有任何改变。

  • Python 2.7
  • Windows 7

【问题讨论】:

    标签: python ssl https python-requests fiddler


    【解决方案1】:
    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")
    

    我必须将 .cer(DER 格式)文件更改为 .pem(PEM 格式)。我意识到 cert 参数不是我想要使用的。上面的代码对我来说是一个解决方案。

    【讨论】:

    • 在控制台中执行命令openssl x509 -inform der -in FiddlerRoot.cer -out FiddlerRoot.pem
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-03-28
    • 2015-12-06
    • 1970-01-01
    • 2019-05-25
    • 2020-05-04
    • 1970-01-01
    • 2011-05-05
    相关资源
    最近更新 更多