Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Conversation

@davidsh
Copy link
Contributor

@davidsh davidsh commented Mar 11, 2016

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.

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.
@davidsh davidsh added area-System.Net blocking Marks issues that we want to fast track in order to unblock other important work labels Mar 11, 2016
@davidsh davidsh added this to the 1.0.0-rc2 milestone Mar 11, 2016
@davidsh
Copy link
Contributor Author

davidsh commented Mar 11, 2016

cc: @stephentoub @CIPop

@davidsh
Copy link
Contributor Author

davidsh commented Mar 11, 2016

cc: @alpaix

if (expectCreds)
{
Task<Socket> secondListen = listener.AcceptSocketAsync();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. It is not needed.

await getAndReadRequest().ConfigureAwait(false);

The code above takes care of listening for subsequent incoming connections.

@stephentoub
Copy link
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
@davidsh davidsh merged commit 8c81732 into dotnet:master Mar 11, 2016
@davidsh davidsh deleted the proxy_auth branch March 11, 2016 16:51
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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Net blocking Marks issues that we want to fast track in order to unblock other important work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants