4

我正在使用MITM Proxy使用 Python Inline Scripts来捕获请求/响应。在证书验证错误的情况下,MITM 代理将日志行写入标准输出,例如

127.0.0.1:34390: SSL verification failed for upstream server at depth 0 with error: 18

是否可以在内联脚本功能中捕获此证书验证错误以及如何捕获?我只能在此脚本中捕获 http 请求和响应。如果内联脚本不可能,也许我可以用libmproxy做到这一点?

4

1 回答 1

2

我遇到了同样的问题。值得庆幸的是 mitmproxy 的代码非常干净且组织良好。您将能够像这样检索错误:

def request(context, flow):
    print flow.server_conn.ssl_verification_error
于 2015-11-11T03:05:55.240 回答