Skip to content

Commit

Permalink
NTLM: force the connection to HTTP/1.1
Browse files Browse the repository at this point in the history
Since v7.62.0, cURL tries to use HTTP/2 whenever the server announces
the capability. However, NTLM authentication only works with HTTP/1.1,
and will likely remain in that boat (for details, see
https://docs.microsoft.com/en-us/iis/get-started/whats-new-in-iis-10/http2-on-iis#when-is-http2-not-supported).

When we just found out that we want to use NTLM, and when the current
connection runs in HTTP/2 mode, let's force the connection to be closed
and to be re-opened using HTTP/1.1.

Fixes curl#3341.
Closes curl#3345

Signed-off-by: Johannes Schindelin <[email protected]>
  • Loading branch information
dscho authored and bagder committed Dec 7, 2018
1 parent 2456152 commit cbea2fd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/http.c
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,12 @@ CURLcode Curl_http_auth_act(struct connectdata *conn)
pickhost = pickoneauth(&data->state.authhost, authmask);
if(!pickhost)
data->state.authproblem = TRUE;
if(data->state.authhost.picked == CURLAUTH_NTLM &&
conn->httpversion > 11) {
infof(data, "Forcing HTTP/1.1 for NTLM");
connclose(conn, "Force HTTP/1.1 connection");
conn->data->set.httpversion = CURL_HTTP_VERSION_1_1;
}
}
if(conn->bits.proxy_user_passwd &&
((data->req.httpcode == 407) ||
Expand Down

0 comments on commit cbea2fd

Please sign in to comment.