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

Conversation

@geoffkizer
Copy link

Fixes #30327.

When we receive an initial NT auth challenge that has Connection: close set on the response, we need to proceed with authentication on a new connection.

@davidsh @dotnet/ncl

@geoffkizer
Copy link
Author

@dotnet-bot test outerloop Linux x64 debug build
@dotnet-bot test outerloop OSX x64 debug build
@dotnet-bot test outerloop Windows x64 debug build

@davidsh
Copy link
Contributor

davidsh commented Aug 3, 2018

I've done a bunch of manual tests with Windows auth scenarios and so far things look good. I'll do more testing and hopefully merge this soon.

@davidsh davidsh merged commit eedddac into dotnet:master Aug 3, 2018
jamshedd added a commit that referenced this pull request Aug 30, 2018
[release/2.1] Handle NT auth with Connection: close on initial challenge #31527
// Server is closing the connection and asking us to authenticate on a new connection.
(connection, response) = await connectionPool.CreateHttp11ConnectionAsync(request, cancellationToken).ConfigureAwait(false);
if (response != null)
{
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Assert that connection is null? If the logic in CreateHttp11ConnectionAsync changes such that both connection and response could be non-null, then the connection pool's count tracking will end up being incorrect.

else
{
return await connection.SendAsync(request, cancellationToken).ConfigureAwait(false);
}
Copy link
Member

@stephentoub stephentoub Sep 24, 2018

Choose a reason for hiding this comment

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

Nit: FWIW, code gen would end up being a bit better if this were instead written to have a single await instead of two, e.g.

Task<HttpResponseMessage> resp = connection is HttpConnection httpConnection ?
    SendWithNtConnectionAuthAsync(httpConnection, request, doRequestAuth, cancellationToken) :
    connection.SendAsync(request, cancellationToken);
return await resp.ConfigureAwait(false);

picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
…refx#31527)

When we receive an initial NT auth challenge that has Connection: close set on the response, we need to proceed with authentication on a new connection.

Fixes dotnet/corefx#30327


Commit migrated from dotnet/corefx@eedddac
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SocketsHttpHandler throws exception when authenticating proxy or server closes first 407 response

3 participants