-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Handle NT auth with Connection: close on initial challenge #31527
Conversation
|
@dotnet-bot test outerloop Linux x64 debug build |
|
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. |
[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) | ||
| { |
There was a problem hiding this comment.
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); | ||
| } |
There was a problem hiding this comment.
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);…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
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