502 error When I try to use FiddlerCore to redirection request

1 Answer 87 Views
FiddlerCore
fei
Top achievements
Rank 1
fei asked on 21 Nov 2022, 01:24 PM

Environment:

FiddlerCore Version: v5.0.1

.Net Version: .net6.0

windows: win11 22h2

Issue

My requirement is when I get the specific request, I need to send another request to get some extra info and then modify some parameters of the original request. I wrote a fiddler script to achieve that and it works fine by Fiddler Classic when I set the TLS1.2 for Https options.

But when I try to use FiddlerCore to do the same thing, I got the 502 error.

I followed https://www.telerik.com/blogs/fiddler-and-modern-tls-versions to set the protocols of connection to support the tls1.2, but it doesn't work!!

Is there anyone can help me figure out what should I do to to resolve this issue

1 Answer, 1 is accepted

Sort by
0
Nick Iliev
Telerik team
answered on 22 Nov 2022, 11:47 AM

Hello Fei Iv,

 

The first thing to note is that in your Fiddler Classic configuration, you have the "Ignore Server certificate errors" enabled, which might mask some possible issues with the server (while the same might throw an error on your server while going through the FiddlerCore requests). Check if you can execute the request without this setting.

The above said, I've tested demo applications (with NET6 and NET4.8), and I can use SendRequestAndWait alongside TLS1.2 without the described issue. Is the problem appearing only with a specific endpoint - perhaps you could test with various endpoints utilizing TLS1.2 and observe if the issue will reappear (and if so, you can send us more details or a demo project)?

 

The demo application we've made using the following code snippet:

// Testing with the following URL:  https://tls-v1-2.badssl.com:1012
session["x-OverrideSslProtocols"] = "ssl3;tls1.0;tls1.1;tls1.2";

if (session.oRequest.host.Contains("badssl.com"))
{
    Console.WriteLine(">>>>>>>>>>>>> SendRequestAndWait (badssl)" + session.oRequest.host);

    if (!String.IsNullOrEmpty(session["X-RetryNumber"])) return;
    for (var iRetry = 1; iRetry < 3; ++iRetry)
    {
        var oSD = new System.Collections.Specialized.StringDictionary();
        oSD.Add("X-RetryNumber", iRetry.ToString());
        var newSession = FiddlerApplication.oProxy.SendRequestAndWait(session.oRequest.headers, session.requestBodyBytes, oSD, null);
        Console.WriteLine(">>>> newSession response code: " + newSession.responseCode);
    }
}

Regards,
Nick Iliev
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
FiddlerCore
Asked by
fei
Top achievements
Rank 1
Answers by
Nick Iliev
Telerik team
Share this question
or