This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Fix WinHttpHandler when using authenticating proxies#30196
Merged
davidsh merged 1 commit intodotnet:masterfrom Jun 8, 2018
davidsh:winhttp_proxy_auth
Merged
Fix WinHttpHandler when using authenticating proxies#30196davidsh merged 1 commit intodotnet:masterfrom davidsh:winhttp_proxy_auth
davidsh merged 1 commit intodotnet:masterfrom
davidsh:winhttp_proxy_auth
Conversation
This was a regression from .NET Core 2.0 due to PR #28105. Proxy authentication using system default proxy settings that involve a PAC file (either autodiscovery or explicit PAC file) cause a NullReferenceException in WinHttpHandler in the CheckResponseForAuthentication() method. This problem is only discovered when using an authenticating proxy server (any auth scheme) that is discovered using PAC files. This is considered the "system default" proxy. When this occurs, the handler's Proxy property is null and dereferencing it caused the exception. Due to the problems described in #6997, the uri of the proxy can't be determined yet since it is only known to WinHTTP. Fixing #6997 is complicated and impacts performance. However, in most cases, as long as the credentials are a NetworkCredential object, knowing the uri of the proxy is needed. I tested this manually using the steps I described in #30191. I did not add any tests to this PR since they can't be run in CI. However, I am working on a task that will eventually add Enterprise-Scenario testing like this (PAC files, authenticating proxies, etc.) to our systems. Fixes #30191 Contributes to #6997
Contributor
Author
|
@dotnet-bot test Outerloop Windows x64 Debug Build |
rmkerr
approved these changes
Jun 7, 2018
Contributor
rmkerr
left a comment
There was a problem hiding this comment.
LGTM. Thanks for fixing this.
Contributor
Author
|
@dotnet-bot test Outerloop Windows x64 Debug Build |
Contributor
Author
|
Unrelated CI failure on Nano in System.Drawing.Common.Performance.Tests: |
picenka21
pushed a commit
to picenka21/runtime
that referenced
this pull request
Feb 18, 2022
…0196) This was a regression from .NET Core 2.0 due to PR dotnet/corefx#28105. Proxy authentication using system default proxy settings that involve a PAC file (either autodiscovery or explicit PAC file) cause a NullReferenceException in WinHttpHandler in the CheckResponseForAuthentication() method. This problem is only discovered when using an authenticating proxy server (any auth scheme) that is discovered using PAC files. This is considered the "system default" proxy. When this occurs, the handler's Proxy property is null and dereferencing it caused the exception. Due to the problems described in dotnet/corefx#6997, the uri of the proxy can't be determined yet since it is only known to WinHTTP. Fixing dotnet/corefx#6997 is complicated and impacts performance. However, in most cases, as long as the credentials are a NetworkCredential object, knowing the uri of the proxy is needed. I tested this manually using the steps I described in dotnet/corefx#30191. I did not add any tests to this PR since they can't be run in CI. However, I am working on a task that will eventually add Enterprise-Scenario testing like this (PAC files, authenticating proxies, etc.) to our systems. Fixes dotnet/corefx#30191 Contributes to dotnet/corefx#6997 Commit migrated from dotnet/corefx@69c2e20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This was a regression from .NET Core 2.0 due to PR #28105.
Proxy authentication using system default proxy settings that involve a PAC file
(either autodiscovery or explicit PAC file) cause a NullReferenceException in WinHttpHandler in the
CheckResponseForAuthentication() method.
This problem is only discovered when using an authenticating proxy server (any auth scheme) that is
discovered using PAC files. This is considered the "system default" proxy. When this occurs, the
handler's Proxy property is null and dereferencing it caused the exception.
Due to the problems described in #6997, the uri of the proxy can't be determined yet since it is only
known to WinHTTP. Fixing #6997 is complicated and impacts performance. However, in most cases, as
long as the credentials are a NetworkCredential object, knowing the uri of the proxy is not needed.
I tested this manually using the steps I described in #30191. I did not add any tests to this PR since
they can't be run in CI. However, I am working on a task that will eventually add Enterprise-Scenario
testing like this (PAC files, authenticating proxies, etc.) to our systems.
Fixes #30191
Contributes to #6997