参考Fiddler在抓取https数据包时如何解决Tunnel to 443的问题?_fiddler显示443-CSDN博客
内容基本和参考链接一致,修改了一处关键错误,在下面的红色字体部分,本文仅作保存方便自用时查找,点赞请给原文章。
1.证书设置点Tools-->Options,HTTPS、connections两个页面按图示设置,弹提示一直点是/YES。
2.在右侧的选项卡里找到FiddlerScript标签(没有找到该标签的施主去FiddlerScript Editor下载安装即可)
3、点击FiddlerScript标签,在Go to 的下拉列表里选择“OnBeforeRequest”
4.下滑到OnBeforeRequest方法的结尾,删除最后一个右大括号 },然后贴上如下代码,如果报错说明你操作不对。
var hosts = 'zkd.me develop.dog'; FiddlerApplication.Log.LogFormat("Logger session {0}, Url: {1}, isHttps: {2}, port: {3}", oSession.id, oSession.fullUrl, oSession.isHTTPS, oSession.port); if(hosts.indexOf(oSession.host) > -1){ FiddlerApplication.Log.LogFormat("Capture session {0}, Url: {1}, isHttps: {2}, port: {3}", oSession.id, oSession.fullUrl, oSession.isHTTPS, oSession.port); if(oSession.HTTPMethodIs('CONNECT')){ FiddlerApplication.Log.LogString('create fake tunnel response'); oSession['x-replywithtunnel'] = 'FakeTunnel'; return; } if (oSession.isHTTPS){ FiddlerApplication.Log.LogString('switch https to http request'); oSession.fullUrl = oSession.fullUrl.Replace("https://","http://"); oSession.port = 80; } FiddlerApplication.Log.LogFormat("Processed session {0}, Url: {1}, isHttps: {2}, port: {3}", oSession.id, oSession.fullUrl, oSession.isHTTPS, oSession.port); } FiddlerApplication.Log.LogFormat("Logger session {0}, Url: {1}, isHttps: {2}, port: {3}", oSession.id, oSession.fullUrl, oSession.isHTTPS, oSession.port);}
然后保存重启fiddler即可。