summaryrefslogtreecommitdiff
path: root/lib/vquic
diff options
context:
space:
mode:
authorDaiki Ueno <dueno@redhat.com>2020-11-26 09:45:48 +0100
committerDaniel Stenberg <daniel@haxx.se>2020-11-26 23:31:53 +0100
commitddd3eb99f87c514fbedeaa33e36246972702b01a (patch)
tree8b88871e879cfb2af7fb708512393d872e4f5195 /lib/vquic
parent0cbd5d5c4f150be7f802ec8898a37445d258cb45 (diff)
downloadcurl-ddd3eb99f87c514fbedeaa33e36246972702b01a.tar.gz
ngtcp2: advertise h3 ALPN unconditionally
Closes #6250
Diffstat (limited to 'lib/vquic')
-rw-r--r--lib/vquic/ngtcp2.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/lib/vquic/ngtcp2.c b/lib/vquic/ngtcp2.c
index 696a5c2a5..348b3bee8 100644
--- a/lib/vquic/ngtcp2.c
+++ b/lib/vquic/ngtcp2.c
@@ -349,14 +349,8 @@ static int quic_init_ssl(struct quicsocket *qs)
SSL_set_app_data(qs->ssl, qs);
SSL_set_connect_state(qs->ssl);
- switch(qs->version) {
-#ifdef NGTCP2_PROTO_VER
- case NGTCP2_PROTO_VER:
- alpn = (const uint8_t *)NGHTTP3_ALPN_H3;
- alpnlen = sizeof(NGHTTP3_ALPN_H3) - 1;
- break;
-#endif
- }
+ alpn = (const uint8_t *)NGHTTP3_ALPN_H3;
+ alpnlen = sizeof(NGHTTP3_ALPN_H3) - 1;
if(alpn)
SSL_set_alpn_protos(qs->ssl, alpn, (int)alpnlen);
@@ -532,15 +526,9 @@ static int quic_init_ssl(struct quicsocket *qs)
return 1;
}
- switch(qs->version) {
-#ifdef NGTCP2_PROTO_VER
- case NGTCP2_PROTO_VER:
- /* strip the first byte (the length) from NGHTTP3_ALPN_H3 */
- alpn.data = (unsigned char *)NGHTTP3_ALPN_H3 + 1;
- alpn.size = sizeof(NGHTTP3_ALPN_H3) - 2;
- break;
-#endif
- }
+ /* strip the first byte (the length) from NGHTTP3_ALPN_H3 */
+ alpn.data = (unsigned char *)NGHTTP3_ALPN_H3 + 1;
+ alpn.size = sizeof(NGHTTP3_ALPN_H3) - 2;
if(alpn.data)
gnutls_alpn_set_protocols(qs->ssl, &alpn, 1, 0);