diff options
author | Jacob Hoffman-Andrews <github@hoffman-andrews.com> | 2021-04-24 18:05:15 -0700 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-04-29 15:04:39 +0200 |
commit | a3268eca792f1c2ff8754de3c4094ee9762b2a87 (patch) | |
tree | 1db9cdc06ab5b21e6374eb50a36545338eb22352 /lib/vtls/bearssl.c | |
parent | 5c932f8fe9dad94a7417702958ffa9e8db67c549 (diff) | |
download | curl-a3268eca792f1c2ff8754de3c4094ee9762b2a87.tar.gz |
tls: add USE_HTTP2 define
This abstracts across the two HTTP/2 backends: nghttp2 and Hyper.
Add our own define for the "h2" ALPN protocol, so TLS backends can use
it without depending on a specific HTTP backend.
Closes #6959
Diffstat (limited to 'lib/vtls/bearssl.c')
-rw-r--r-- | lib/vtls/bearssl.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/vtls/bearssl.c b/lib/vtls/bearssl.c index 673e3863a..7f729713d 100644 --- a/lib/vtls/bearssl.c +++ b/lib/vtls/bearssl.c @@ -385,14 +385,14 @@ static CURLcode bearssl_connect_step1(struct Curl_easy *data, * protocols array in `struct ssl_backend_data`. */ -#ifdef USE_NGHTTP2 +#ifdef USE_HTTP2 if(data->state.httpwant >= CURL_HTTP_VERSION_2 #ifndef CURL_DISABLE_PROXY && (!SSL_IS_PROXY() || !conn->bits.tunnel_proxy) #endif ) { - backend->protocols[cur++] = NGHTTP2_PROTO_VERSION_ID; - infof(data, "ALPN, offering %s\n", NGHTTP2_PROTO_VERSION_ID); + backend->protocols[cur++] = ALPN_H2; + infof(data, "ALPN, offering %s\n", ALPN_H2); } #endif @@ -540,8 +540,8 @@ static CURLcode bearssl_connect_step3(struct Curl_easy *data, if(protocol) { infof(data, "ALPN, server accepted to use %s\n", protocol); -#ifdef USE_NGHTTP2 - if(!strcmp(protocol, NGHTTP2_PROTO_VERSION_ID)) +#ifdef USE_HTTP2 + if(!strcmp(protocol, ALPN_H2)) conn->negnpn = CURL_HTTP_VERSION_2; else #endif |