如何排查调用第三方API时使用的TLS版本(Fiddler未显示)
Hey there! Let me walk you through a few reliable ways to track down the TLS version your requests are using, since the TextView method you tried didn’t pan out.
Check the Statistics Tab in Fiddler
Select the captured HTTPS request in Fiddler’s session list, then switch to the Statistics tab. Scroll all the way to the bottom of this tab—you’ll see an entry starting withTunnel to [API domain]:443(or whatever port the API uses). This line will explicitly state the TLS version negotiated (e.g.,TLS 1.2orTLS 1.3).Add FiddlerScript to Log TLS Versions
If the Statistics tab doesn’t show what you need, you can add custom script to log TLS details:- Go to Rules > Customize Rules to open the FiddlerScript editor.
- Find the
OnBeforeRequestfunction, and add this code inside it:if (oSession.isHTTPS) { FiddlerApplication.Log.LogString($"Session {oSession.id} | API: {oSession.host} | TLS Version: {oSession.Request.pipe.TLSVersion}"); } - Save the script, then go to View > Log to see the TLS version for every HTTPS request as it’s captured.
Verify HTTPS Decryption is Enabled
Sometimes Fiddler won’t show TLS details if it’s not decrypting HTTPS traffic properly. Double-check:- Go to Tools > Options > HTTPS
- Ensure the box for Decrypt HTTPS traffic is checked
- Follow the prompts to install Fiddler’s root certificate if you haven’t already
Use .NET Network Tracing (For .NET Clients)
Since you referenced a .NET client guide earlier, enabling network tracing directly in your app can also reveal TLS info. Add this to yourapp.configorweb.configfile:<system.diagnostics> <sources> <source name="System.Net" tracemode="protocolonly" maxdatasize="1024"> <listeners> <add name="System.Net"/> </listeners> </source> </sources> <sharedListeners> <add name="System.Net" type="System.Diagnostics.TextWriterTraceListener" initializeData="network_trace.log"/> </sharedListeners> <switches> <add name="System.Net" value="Verbose"/> </switches> </system.diagnostics>Run your client, then open the generated
network_trace.logfile. Search for terms likeTLSorProtocolVersionto find the exact TLS version being used.
Hope one of these methods helps you get the TLS version info you need!
内容的提问来源于stack exchange,提问作者kamal

