Fiddler: Error 502 Proxy Error - asp.net

I am using Fiddler to debug all HTTP request of my ASP.NET application.
For a while (about 6 months) I had no problem. All HTTP requests appeared on Fiddler and so on.
The last two days Fiddler stoped working :/ Always returns the same error: "The request failed with HTTP status 502: Proxy Error ( The ISA Server denied the specified Uniform Resource Locator (URL). )."
The strange thing is that only happens to my application, i. e. all HTTP requests from youtube, email, etc, appear on Fiddler.
What is the problem here?

From my case adding this line on OnBeforeRequest function in Fiddler Script fixed it for me,
oSession["x-OverrideSslProtocols"] = " ssl3;tls1.0;tls1.1;tls1.2";

I had the same issue with Fiddler - my HTTPS site worked fine in IE, however got 502 error in Chrome. After analyzing the issue, I found that has manual proxy enabled in Fiddler (not recommended):
Tools -> Fiddler Options -> Gateaway
it was the root cause of this strange behavior. Switching to "System Proxy" made this working for both IE and Chrome.

I had a scenario where production url was https and test was http.
When wrongly calling test with https in fiddler then I got 502 and ended here on stack overflow.
I will just leave this here in case anyone else does the same mistake.

I solved my problem =)
I seems that something changed at my company network. So I changed the file CustomRules.js from Fiddler and added some lines at OnBeforeRequest.
Now, everything works just fine
Best regards.

Related

IIS Node.js server download files relay error on Firefox and Chrome

I'm using IIS 10 server as a gateway for Node.js server.
When client calls download files such as zip file, IIS server download Node.js server internally with HTTP protocol, and then it pass to client with HTTPS.
But in Chrome web browser, It shows error
net::ERR_HTTP_1_1_REQUIRED with status 200, and when I try to download again it works well until I clear the caches.
In Firefox, it returns status 200 too, but nothing's happen.
In Microsoft Edge and IE11 works well too.
I've set enough timeout and buffer size in IIS.
May Chrome and Firefox go wrong at HTTPS - HTTP connection or something else?
There may be some extensions in your Firefox and Chrome that can cause this error. This error means a browser extension blocked the request. The most common culprit is an ad blocker like AdBlock Plus. In short your requests to server have been blocked by an extension. so you can try to disable these extensions and try again.
It seems that the .NET Core team found a related issue and provided a workaround.
Perhaps the same can be applied with other frameworks.
https://github.com/dotnet/aspnetcore/issues/4398
Apparently, when doing an ajax request from a browser, it will sometimes send an OPTIONS request before the real request with a 204 status code which causes the problem.
For me, it seems to have solved my problem to return the file with a response content-type of "text/plain" instead of "application/octet-stream"
I'm not really sure why it works, it just does.

ASP.NET debugger gives errors with http, while working with https

I really desperately need your help because I got very unusual problem with my programs:
I am receiving this error when I am trying to debug my ASP.NET or MVC Application on local IIS Server 7.5:
"Unable to start debugging on the web server. The debug request could not be processed by the server due to invalid syntax. "
I tried literally every solution I could find in google until this day. I spent 12 hours trying to figure this out. Without luck.
Error happens only with this address: http:// localhost/AspDemo not with this one: https:// localhost/AspDemo. Basically, I can debug like always if I put https instead of http.
https is disabled on my local IIS server :), I mean it is set to ignore.
Moreover I CAN open my sites with using BOTH protocols in IIS Control Panel
If I disable ASP.NET Debugger in Properties of my App in Visual Studio, Application runs fine.
This is the error from the httperr log:
2014-10-30 00:23:46 ::1%0 2977 ::1%0 80 - - - 400 - Verb -
I am not sure where exactly, but in some other log I saw reference to something like this: Error 400 "Bad Request - Invalid Verb"
A week ago ALL applications I got problems with were working perfectly with asp.net debugger from visual studio, I had no idea what happened.
I suspect some update. Because updates lately messed with my custom bootloader as well.
When I enable tracing - log is empty with http
Fiddler log is empty as well, maybe there is some config I can use in Fiddler to produce some more logs? (It logs of course with modified machine.config when I use https)
Would be eternally grateful for your help, if you need some more logs, please don't hestitate to ask.
I would like to mention as well that yes, I saw similar posts on this site, but none of them described problem this similar to mine.
/edit
From what I was able to observe, error happens BEFORE debugger access machine.config file, can you guys tell me how to catch errors in that moment?
==== /edit 2 ====
Anyone? No one knows the answer?
Recently I was able to find the complete error message in: C:\Users\\AppData\Local\Temp\Visual Studio Web Debugger.log
http://localhost/MVCDemo/debugattach.aspx
Status code=400 (Bad Request)
Protocol version=1.1
Cached=False
Connection=close
Content-Length=326
Content-Type=text/html; charset=us-ascii
Date=Fri, 31 Oct 2014 03:44:14 GMT
Server=Microsoft-HTTPAPI/2.0
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Bad Request</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Bad Request - Invalid Verb</h2>
<hr><p>HTTP Error 400. The request verb is invalid.</p>
</BODY></HTML>
In proccess monitor, I found this one as well:
<event>
<ProcessIndex>1339</ProcessIndex>
<Time_of_Day>04:40:33,3661553</Time_of_Day>
<Process_Name>devenv.exe</Process_Name>
<PID>10768</PID>
<Operation>CreateFile</Operation>
<Path>C:\Users\<UserName>\AppData\Roaming\Microsoft\VisualStudio\12.0\Debugger\StepIntoFilterData.ini</Path>
<Result>PATH NOT FOUND</Result>
<Detail>Desired Access: Read Data/List Directory, Read Attributes, Synchronize, Disposition: Open, Options: Sequential Access, Synchronous IO Non-Alert, Non-Directory File, Attributes: n/a, ShareMode: Read, Delete, AllocationSize: n/a</Detail>
</event>
I really, really need help with this.
=== /edit 3 ===
Second error is not relevant, I just checked and it is present with https as well (C:\Users\\AppData\Roaming\Microsoft\VisualStudio\12.0\Debugger\StepIntoFilterData.in), and debugging as https localhost works perfectly.
=== /edit 4 ===
Here are Process Monitor logs captured during Visual Studio Debugging HTTP (not working) and HTTPS (working)
(Test performed on random MVC Tutorial)
Use CTRL+F and Look for "Visual Studio Web Debugger.log" in logs to get the idea when it is happening. In https log is good, in http log returns Invalid Verb error mentioned before.
HTTP (not working)::
https://www.dropbox.com/s/7b26ybogtyqlico/LogFile%20HTTP%20NOT%20Working.CSV?dl=0
HTTPS (working):
https://www.dropbox.com/s/ggsj57v97ky90e6/LogFile%20HTTPS%20Working.CSV?dl=0
I might be wrong, but I think the key here is that only HTTP doesn't work and only with VS Debugger, everything else is just fine (HTTP and HTTPS without debugging and HTTPS with debugging.)
(It happens with every solution on IIS, new ones are affected too, all of these solutions were working, moreover some of them were not even changed from the time they have been working, IIS config didn't change as well)
I do not see the name of the verb in any of the description here, but my guess is VS debugger using a special verb (DEBUG) rather than the standard GET, HEAD, POST, etc. If you re-installed IIS after VS, the ISAPI mapping probably got nuked. This may solve the problem:
https://msdn.microsoft.com/en-us/library/ms165022%28v=vs.90%29.aspx

IIS7 .NET (2.0, 4.0) completely hosed with a Bad Request (Error Code 400) error

All of a sudden all of my websites on my server return 400 Bad Request Error. I don't have a clue what happened. App Pools are running in Classic pipeline mode (4.0, 2.0), doesn't matter.
Every URL that I type comes back as 400 Bad Request. Real URLs, even fake URLs that don't exist (which should come back as 404) all are 400.
http://mywebsite.com/AFile.aspx
http://mywebsite.com/AFolder/AnotherFile.aspx
http://mywebsite.com/Bfolder/YetAnotherSillyPage.aspx
http://mywebsite.com/A_stupid_URL_that_does_not_even_exist_fjfjffjfj.aspx
Everything 400 Bad Request. Totally screwed up my ASP.NET. Where should I begin to look? Machine.config? Web.config?
UPDATE:
After trying a million different settings, I finally set the App Pool to Integrated and set the Identity to LocalSystem and all of a sudden it works.
Bad Request usually is HTTP.sys stopping the request due to something really bad (like invalid URLs, or something like that).
You probably should look at HTTP.sys logs (Not IIS) at:
C:\Windows\System32\LogFiles\HTTPERR
Also, maybe something got broken in the http.sys configuration so try running:
netsh http show servicestate
And see if for your web site it has the correct bindings, for example it could be that the bindings are only listening on only specific IP Addresses and yet its coming from another one, or similar problem but with Host Name, etc.
Finally you might want to run:
C:\Windows\System32\inetsrv\appcmd list sites
And see if the bindings and status makes sense.
Have you tried some mixture of re-installing (or uninstall/install) asp.net using the aspnet_regiis.exe utility? That's fixed strange IIS/ASP.NET server issues for me in the past.
Have you looked in the event log for any error messages or further clues?

How can a HTTP request be instantiated with a different host?

Strange one here folks.
I'm studiying a web application's inner workings using Fiddler and have become a bit stumped. I'm requesting /account via the browser and Fiddler shows in the "Host" column website.local as expected since this is the URL the browser is pointing at.
Immediately after this a second request is made, however this time the host is services.website.com. I also cannot find any script in /account that makes this request.
So how can the Host change? Where is the response being sent to? Where can this be getting called from?
I'd expect that the server is sending a redirect to services.website.com: Fiddler isn't showing any redirects?
It depends on what really is in the first response that you receive. When you see a second request in Fiddler, does the page change too (in the browser)?
It will help a great deal if you could share the part of the Fiddler trace.

"Method Not Implemented" error - Firefox 3

Getting sporadic errors from users of a CMS; Ajax requests sometimes result in a "501 Method not implemented" response from the server. Not all the time; usually works.
Application has been stable for months. Users seem to be getting it with Firefox 3. I've seen a couple references via Google to such problems being related to having "charset=UTF-8" in the Content-type header, but these may be spurious
Has anyone seen this error or have any ideas about what the cause could be?
Thanks
Ian
You may want to check the logs of the server to see what's causing the issue. For example, it might be that these requests are garbled, say, because of a flaw in the HTTP 1.1 persistent connection implementation.
Try this
Try clearing your cookies and your cache
Type about:config into the URL bar, list of configuration settings for Firefox
Locate the setting for 'network.automatic-ntlm-auth.trusted-uris'
Set the value of names of the servers to use NTLM with.
Locate the setting for 'network.negotiate-auth.trusted-uris'
Set the value of names of the servers to use NTLM with.
network.automatic-ntlm-auth.allow-proxies = True
Restart Firefox - Test URL to application
The problem occurs as your app is not running on the same domain as your service. You need to configure your Server to accept those calls by adding the 'Access-Control-Allow-Origin' Header.

Resources