502 Proxy/Gateway Connection Failed

6 posts, 0 answers
  1. Jason
    Jason avatar
    3 posts
    Member since:
    Apr 2018

    Posted 24 Apr Link to this post

    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?

  2. Simeon
    Admin
    Simeon avatar
    116 posts

    Posted 09 May Link to this post

    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
  3. Jason
    Jason avatar
    3 posts
    Member since:
    Apr 2018

    Posted 15 May in reply to Simeon Link to this post

    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.

  4. Simeon
    Admin
    Simeon avatar
    116 posts

    Posted 16 May Link to this post

    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
  5. Jason
    Jason avatar
    3 posts
    Member since:
    Apr 2018

    Posted 18 May in reply to Simeon Link to this post

    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.]

     

     

  6. Simeon
    Admin
    Simeon avatar
    116 posts

    Posted 21 May Link to this post

    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
Back to Top