mbedtls: remove 'protocols' array from backend when ALPN is not used

Closes #8663
This commit is contained in:
MAntoniak 2022-04-01 13:43:10 +02:00 committed by Daniel Stenberg
parent fda4b81635
commit 266627b0bc
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -70,6 +70,14 @@
#include "curl_memory.h"
#include "memdebug.h"
/* ALPN for http2 */
#ifdef USE_HTTP2
# undef HAS_ALPN
# ifdef MBEDTLS_SSL_ALPN
# define HAS_ALPN
# endif
#endif
struct ssl_backend_data {
mbedtls_ctr_drbg_context ctr_drbg;
mbedtls_entropy_context entropy;
@ -82,7 +90,9 @@ struct ssl_backend_data {
#endif
mbedtls_pk_context pk;
mbedtls_ssl_config config;
#ifdef HAS_ALPN
const char *protocols[3];
#endif
};
/* apply threading? */
@ -144,14 +154,6 @@ static void mbed_debug(void *context, int level, const char *f_name,
#else
#endif
/* ALPN for http2 */
#ifdef USE_HTTP2
# undef HAS_ALPN
# ifdef MBEDTLS_SSL_ALPN
# define HAS_ALPN
# endif
#endif
/*
* profile
*/