1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-14 21:45:13 -05:00

ngtcp2: Use ALPN h3-29 for now

Fixes #6864
Cloes #6886
This commit is contained in:
Tatsuhiro Tsujikawa 2021-04-13 21:01:20 +09:00 committed by Daniel Stenberg
parent 0409c12ae7
commit f141b0bbf7
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -57,6 +57,8 @@
#define H3BUGF(x) do { } while(0) #define H3BUGF(x) do { } while(0)
#endif #endif
#define H3_ALPN_H3_29 "\x5h3-29"
/* /*
* This holds outgoing HTTP/3 stream data that is used by nghttp3 until acked. * This holds outgoing HTTP/3 stream data that is used by nghttp3 until acked.
* It is used as a circular buffer. Add new bytes at the end until it reaches * It is used as a circular buffer. Add new bytes at the end until it reaches
@ -351,8 +353,8 @@ static int quic_init_ssl(struct quicsocket *qs)
SSL_set_app_data(qs->ssl, qs); SSL_set_app_data(qs->ssl, qs);
SSL_set_connect_state(qs->ssl); SSL_set_connect_state(qs->ssl);
alpn = (const uint8_t *)NGHTTP3_ALPN_H3; alpn = (const uint8_t *)H3_ALPN_H3_29;
alpnlen = sizeof(NGHTTP3_ALPN_H3) - 1; alpnlen = sizeof(H3_ALPN_H3_29) - 1;
if(alpn) if(alpn)
SSL_set_alpn_protos(qs->ssl, alpn, (int)alpnlen); SSL_set_alpn_protos(qs->ssl, alpn, (int)alpnlen);
@ -529,8 +531,8 @@ static int quic_init_ssl(struct quicsocket *qs)
} }
/* strip the first byte (the length) from NGHTTP3_ALPN_H3 */ /* strip the first byte (the length) from NGHTTP3_ALPN_H3 */
alpn.data = (unsigned char *)NGHTTP3_ALPN_H3 + 1; alpn.data = (unsigned char *)H3_ALPN_H3_29 + 1;
alpn.size = sizeof(NGHTTP3_ALPN_H3) - 2; alpn.size = sizeof(H3_ALPN_H3_29) - 2;
if(alpn.data) if(alpn.data)
gnutls_alpn_set_protocols(qs->ssl, &alpn, 1, 0); gnutls_alpn_set_protocols(qs->ssl, &alpn, 1, 0);