502 Proxy/Gateway Connection Failed

1 Answer 17891 Views
Windows
Jason
Top achievements
Rank 1
Jason asked on 24 Apr 2018, 07:03 PM

Have recently jumped from v2.3 to v5 and am having issues with a 502 error, "Gateway Connection Failed". This failure seems to be occurring randomly. For example, I can start capturing web traffic just fine, and in this case, I'm using Fiddler to ensure eLearning courses are sending a heartbeat/keep-alive to our Learning Management System.

The keep-alive occurs every minute. I'm experiencing the 502 error following one or more successful keep-alive POST events.

The response header specifically states:

502 Fiddler - Gateway Connection Failed

Cache-Control: no-cache, must-revalidate

[Fiddler] The connection to the upstream proxy/gateway failed. Closing Fiddler, changing your system proxy settings, and restarting Fiddler may help. 
System.Exception Upstream Gateway refused requested CONNECT. 407

 

Can I utilize a FiddlerScript or AutoResponder to keep Fiddler authenticated to the proxy/gateway?

1 Answer, 1 is accepted

Sort by
0
Simeon
Telerik team
answered on 09 May 2018, 04:01 PM
Hi Jason,

Sorry for the late reply. You could either enable the Rules > Automatically Authenticate menu to instruct Fiddler to automatically respond to the gateway proxy authentication challenge. This sets the 'x-AutoAuth' property of the Fiddler sessions to '(default)'

Warning: If Fiddler is configured to accept requests from other devices or user-accounts, using (default) introduces a security vulnerability. That’s because those requests will be authenticated using the credentials of the account in which Fiddler is running.

Alternatively, you could set the 'x-AutoAuth' property with FiddlerScript:
public static void OnBeforeRequest(Session oSession)
{
    // To use the current Fiddler user's credentials:
    if (oSession.HostnameIs("ServerThatDemandsCreds"))
    {
        oSession["x-AutoAuth"] = "(default)";
    }
 
    // or, to use explicit credentials...
    if (oSession.HostnameIs("ServerUsingChannelBinding"))
    {
        oSession["x-AutoAuth"] = "domain\\username:password";
    }
    //...
}


Regards,
Simeon
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Jason
Top achievements
Rank 1
commented on 15 May 2018, 05:12 PM

Hi Simeon,

I've recently come to understand we have/use a PAC script.

Unfortunately, utilizing Rules > Automatically Authenticate did not resolve my issue. If we have a PAC script, I presume I should enable that option, but are there other options I should *disable* in order for the PAC to function correctly with Fiddler?

Thanks in advance for your assistance.

Simeon
Telerik team
commented on 16 May 2018, 07:30 PM

Hi Jason,

I assume that your system proxy settings are set to use the PAC script. You can check this by typing 'Configure proxy server' into the Windows' Search field, then click the 'LAN settings' button. You should see either that the 'Automatically detect settings' checkbox is clicked, or that the 'Use automatic configuration script' is checked and the Address field is filled.

If this is the case, open Fiddler and then go to 'Tools\Options...' menu, click on the 'Gateway' tab and make sure that the 'Use System Proxy (recommended)' radio button is clicked. Click OK and restart Fiddler.

Now Fiddler, should use your PAC script. If you still have a problem, please, copy and send me the content of the 'Log' tab of Fiddler.

Regards,
Simeon
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Jason
Top achievements
Rank 1
commented on 18 May 2018, 02:21 PM

Hi Simeon,

Indeed the system is configured to use the PAC script. I configured Fiddler as you specified, but am still running into issues. Here's the txt from the Fiddler log as requested...

-= Fiddler Event Log =-

10:07:36:5715 Proxy Configuration Script specified an unreachable proxy:  for URL: http://newsflash.schwab.com/
10:09:49:7043 Proxy Configuration Script specified an unreachable proxy:  for URL: http://newsflash.schwab.com/
10:09:49:7043 Proxy Configuration Script specified an unreachable proxy:  for URL: http://newsflash.schwab.com/
10:10:05:1226 Automatic authentication of Session #177 was unsuccessful. System.NullReferenceException Object reference not set to an instance of an object.
   at Fiddler.Session.ž() in C:\JenkinsHome\jobs\FiddlerReleaseBuild\workspace\Fiddler2\Common\Core\Session.cs:line 4432
10:12:53:6196 Proxy Configuration Script specified an unreachable proxy:  for URL: http://newsflash.schwab.com/
10:12:54:5884 Proxy Configuration Script specified an unreachable proxy:  for URL: https://remote.schwab.com/

[NOTE: There are many more entries in the log that are identical to the entries above. I truncated the log in the interest of simplicity.]

 

 

Simeon
Telerik team
commented on 21 May 2018, 03:20 PM

Hi Jason,

Thank you for your your reply. It seems that there could be a bug in Fiddler. In order to reproduce it, I would need the sessions, captured by Fiddler, saved as a SAZ file. Please, open Fiddler, reproduce the problem with the proxy authentication and then from the menu click File\Save\All Sessions..., save the file and send it to us.

Thank You for the co-operation.

Regards,
Simeon
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Amit
Top achievements
Rank 1
commented on 25 Jan 2019, 12:58 PM

I am gettting the same problem . Could you please provide the solution.
Christopher
Top achievements
Rank 1
commented on 22 May 2020, 09:59 PM

I'm also having the same issue.
Nick Iliev
Telerik team
commented on 26 May 2020, 06:22 AM

Hey there Amit and Christopher,

 

As my colleague, Simeon, said a good step in understanding the issue would be if you could provide a SAZ file with the problematic session. There might be multiple different reasons for a 502 (Connection failed). The best approach would be to create and post the archive (make sure it does not contain sensitive information). This way other Fiddler users could take a look at it and provide guidance.

 

Regards,
Nick Iliev
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
Windows
Asked by
Jason
Top achievements
Rank 1
Answers by
Simeon
Telerik team
Share this question
or