diff options
author | Joel Depooter <joel.depooter@safe.com> | 2021-05-26 18:33:34 -0700 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-05-27 08:27:35 +0200 |
commit | ee97f176970c9667bfbdaab89bc637e77099d1df (patch) | |
tree | b088aa0206bb2de9a68a22a6b0d5f0ddd424ad6c /lib/vtls/schannel.c | |
parent | 5f7fef70a9cc31cf693f61065748b211a225d1d4 (diff) | |
download | curl-ee97f176970c9667bfbdaab89bc637e77099d1df.tar.gz |
schannel: set ALPN length correctly for HTTP/2
In a3268eca792f1 this code was changed to use the ALPN_H2 constant
instead of the NGHTTP2_PROTO_ALPN constant. However, these constants are
not the same. The nghttp2 constant included the length of the string,
like this: "\x2h2". The ALPN_H2 constant is just "h2". Therefore we need
to re-add the length of the string to the ALPN buffer.
Closes #7138
Diffstat (limited to 'lib/vtls/schannel.c')
-rw-r--r-- | lib/vtls/schannel.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c index 2bcf11db2..3286a9e9f 100644 --- a/lib/vtls/schannel.c +++ b/lib/vtls/schannel.c @@ -874,6 +874,7 @@ schannel_connect_step1(struct Curl_easy *data, struct connectdata *conn, #ifdef USE_HTTP2 if(data->state.httpwant >= CURL_HTTP_VERSION_2) { + alpn_buffer[cur++] = ALPN_H2_LENGTH; memcpy(&alpn_buffer[cur], ALPN_H2, ALPN_H2_LENGTH); cur += ALPN_H2_LENGTH; infof(data, "schannel: ALPN, offering %s\n", ALPN_H2); |