沒有人幫助我,但我找到了解決方案。
解決方案:
啓用捕獲HTTPS TRAFIC更新寄存器的值:
reg.exe add "HKEY_LOCAL_MACHINE\Software\Microsoft\Fiddler2" /v CaptureCONNECT /t REG_SZ /d True /f
reg.exe add "HKEY_LOCAL_MACHINE\Software\Microsoft\Fiddler2" /v CaptureHTTPS /t REG_SZ /d True /f
reg.exe add "HKEY_LOCAL_MACHINE\Software\Microsoft\Fiddler2" /v IgnoreServerCertErrors /t REG_SZ /d True /f
reg.exe add "HKEY_CURRENT_USER\Software\Microsoft\Fiddler2" /v CaptureCONNECT /t REG_SZ /d True /f
reg.exe add "HKEY_CURRENT_USER\Software\Microsoft\Fiddler2" /v CaptureHTTPS /t REG_SZ /d True /f
reg.exe add "HKEY_CURRENT_USER\Software\Microsoft\Fiddler2" /v IgnoreServerCertErrors /t REG_SZ /d True /f
您需要使用自定義的小提琴手的腳本。它強制fiddler生成ssl證書(請參見下面的腳本CustomRules.js中的主要部分)。如果你不添加它,小提琴手將開始沒有ssl證書。
copy /Y /V "<path to file>\CustomRules.js" "%userprofile%\Documents\Fiddler2\Scripts\CustomRules.js"
注意:不要更改目標文件名。
當小提琴手automaticaly開始在連接到插座127.0.0.1:8888
start "" "%programfiles(x86)%\fiddler2\fiddler.exe" -quiet
小提琴手會自動創建一個新的SSL證書。 可以下載:
curl.exe -s -k -o <dst file path> "http://127.0.0.1:8888/FiddlerRoot.cer"
然後,你需要將它添加到受信任的根證書
certutil -addstore -f "Root" <path to certificate>
現在fiddelr啓動並可以捕捉HTTPS TRAFIC期運用CustomRules.js。
Fiddler.bat:
@ECHO OFF
set currentDir=%~dp0
cd "%currentDir%"
set log="%currentDir%\fiddler.log"
set fiddler_custom_script_dir="%userprofile%\Documents\Fiddler2\Scripts\"
set fiddler_result_dir="C:\fiddler\"
echo "Start Fiddler Script" > "%log%"
echo "Current Dir: %currentDir%" >> "%log%"
echo "Update values in the register" >> "%log%"
reg.exe add "HKEY_LOCAL_MACHINE\Software\Microsoft\Fiddler2" /v CaptureCONNECT /t REG_SZ /d True /f >> "%log%"
reg.exe add "HKEY_LOCAL_MACHINE\Software\Microsoft\Fiddler2" /v CaptureHTTPS /t REG_SZ /d True /f >> "%log%"
reg.exe add "HKEY_LOCAL_MACHINE\Software\Microsoft\Fiddler2" /v IgnoreServerCertErrors /t REG_SZ /d True /f >> "%log%"
reg.exe add "HKEY_CURRENT_USER\Software\Microsoft\Fiddler2" /v CaptureCONNECT /t REG_SZ /d True /f >> "%log%"
reg.exe add "HKEY_CURRENT_USER\Software\Microsoft\Fiddler2" /v CaptureHTTPS /t REG_SZ /d True /f >> "%log%"
reg.exe add "HKEY_CURRENT_USER\Software\Microsoft\Fiddler2" /v IgnoreServerCertErrors /t REG_SZ /d True /f >> "%log%"
echo "Create folder for results: %fiddler_result_dir%" >> "%log%"
mkdir "%fiddler_result_dir%" >> "%log%"
echo "Create folder for the custom fiddler's script: %fiddler_custom_script_dir%" >> "%log%"
mkdir "%fiddler_custom_script_dir%" >> "%log%"
echo "Copy fiddler script to %fiddler_custom_script_dir%" >> "%log%"
copy /Y /V "%currentDir%\CustomRules.js" "%fiddler_custom_script_dir%\CustomRules.js" >> "%log%"
echo "Start fiddler" >> "%log%"
start "" "%programfiles(x86)%\fiddler2\fiddler.exe" -quiet
set cert_path="%currentDir%\FiddlerRoot.cer"
set /a attempt=0
timeout 10 > nul
:get_cert
set /a attempt+=1
timeout 1 > nul
echo "Attempt #%attempt% to download fiddeler's certificate" >> "%log%"
curl.exe -s -k -o "%cert_path%" "http://127.0.0.1:8888/FiddlerRoot.cer" >> "%log%"
if not exist "%cert_path%" if %attempt% LSS 300 goto get_cert
if not exist "%cert_path%" (
echo "FAIL. Certificate "%cert_path%" doesn't exist. Cannot set trusted certificate" >> "%log%"
exit /b -100
)
set /a attempt=0
echo "Try to add certificate to trusted" >> "%log%"
echo certutil -addstore -f "Root" %cert_path% >> "%log%"
:import_cert
set /a attempt+=1
timeout 1 > nul
echo "Attempt #%attempt% to download fiddeler's certificate" >> "%log%"
certutil -addstore -f "Root" %cert_path% >> "%log%"
if "%errorlevel%" LSS 0 if %attempt% LSS 3 goto import_cert
echo "End..." >> "%log%"
exit /b 0
CustomRules.js
import System;
import System.Windows.Forms;
import Fiddler;
/**
This script must be in the folder C:\Users\<USER>\Documents\Fiddler2\Scripts\CustomRules.js
*/
class Handlers
{
// The Main() function runs everytime your FiddlerScript compiles
static function Main() {
var today: Date = new Date();
FiddlerObject.StatusText = " CustomRules.js was loaded at: " + today;
CertMaker.createRootCert();
//CertMaker.GetRootCertificate().GetPublicKeyString()
}
}
Stack Overflow是用於編程和發展問題的站點。此問題似乎無關緊要,因爲它不在「幫助中心」中定義的範圍內。請參閱幫助中心的[我可以詢問哪些主題](http://stackoverflow.com/help/on-topic)。也許[超級用戶](http://superuser.com/)或[反向工程堆棧交換](http://reverseengineering.stackexchange.com/)是一個更好的地方。 – jww
我正在開發一個使用提琴手的應用程序。它是應用程序的一部分。我試圖找到答案沒有太大的成功。我閱讀[我可以在這裏詢問什麼主題](https://stackoverflow.com/help/on-topic)。小提琴手是「程序員常用的軟件工具」。我沒有看到任何差異。 –
順便說一句,你可以找到很多關於小提琴手在這裏的計算器問題。 –