This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Fix WinHttpHandler when no proxy creds after 407 response#6822
Merged
davidsh merged 2 commits intodotnet:masterfrom Mar 11, 2016
davidsh:proxy_auth
Merged
Fix WinHttpHandler when no proxy creds after 407 response#6822davidsh merged 2 commits intodotnet:masterfrom davidsh:proxy_auth
davidsh merged 2 commits intodotnet:masterfrom
davidsh:proxy_auth
Conversation
We were getting an assert if we had an authenticating proxy but didn't have any credentials to send. After the initial 407 was received from the proxy, we then tried to set credentials for a retry. But since we didn't have any, we triggered an assert in SetWinHttpCredential. The fix is to check for null credentials after getting the 407 response. If there are no credentials, then we end the retry loop with the final 407 status code.
Contributor
Author
|
cc: @stephentoub @CIPop |
Contributor
Author
|
cc: @alpaix |
| if (expectCreds) | ||
| { | ||
| Task<Socket> secondListen = listener.AcceptSocketAsync(); | ||
| } |
Member
There was a problem hiding this comment.
Do we need this at all? I think I inadvertently left this line in with some changes before, and it looks like it's unnecessary and could even cause problems in the test.
Contributor
Author
There was a problem hiding this comment.
You're right. It is not needed.
await getAndReadRequest().ConfigureAwait(false);The code above takes care of listening for subsequent incoming connections.
Member
|
Other than one comment, LGTM. |
davidsh
added a commit
that referenced
this pull request
Mar 11, 2016
Fix WinHttpHandler when no proxy creds after 407 response
picenka21
pushed a commit
to picenka21/runtime
that referenced
this pull request
Feb 18, 2022
Fix WinHttpHandler when no proxy creds after 407 response Commit migrated from dotnet/corefx@8c81732
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.
We were getting an assert if we had an authenticating proxy but didn't have any credentials to send. After the initial 407 was received from the proxy, we then tried to set credentials for a retry. But since we didn't have any, we triggered an assert in SetWinHttpCredential.
The fix is to check for null credentials after getting the 407 response. If there are no credentials, then we end the retry loop with the final 407 status code.