Closed davidsh closed 4 years ago
cc: @stephentoub @geoffkizer
How is this different than dotnet/runtime#26461? The repro code above is sending Connection: close. Are you saying that even without this, it fails?
How is this different than dotnet/runtime#26461? The repro code above is sending Connection: close. Are you saying that even without this, it fails?
Yes. I'll edit the repro above to make it clearer. It fails to authenticate in both 'Connection: close' / 'Proxy-Connection: close' cases or not. And by "fails", I mean it stops doing any authentication and just returns final 407 response. No exceptions are thrown.
Fixed in master with dotnet/corefx#30478
Fixed in release/2.1 with dotnet/corefx#30516 - will be part of 2.1.3 release.
Found this bug while investigating dotnet/runtime#26397.
When connecting to an HTTPS endpoint thru an authenticating proxy server where the proxy server uses Windows authentication schemes (Negotiate or NTLM), SocketsHttpHandler will not send any credentials. This causes the final HTTP response to be a 407. This occurs whether or not the authenticating proxy server closes the initial 407 response (see dotnet/runtime#26461 for related bug).
Repro code showing an authenticating proxy and resulting in no authentication by the handler and ending with a final 407 response:
If you run this code, you'll see that the loopback proxy server only receives 1 request.
If you change the above code so that the proxy only requests 'Basic' scheme, then the loopback proxy server receives 2 requests where the second request has the 'Proxy-Authorization Basic blob' request header.