From 3085eb7ec6ca1ffff4cce1f16aae284cf4cd49f5 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Fri, 8 Dec 2017 13:00:11 +0800 Subject: [PATCH] openssl: add feature check for MBEDTLS_SSL_ALPN Fixes https://github.com/espressif/esp-idf/issues/1342 --- components/openssl/platform/ssl_pm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/openssl/platform/ssl_pm.c b/components/openssl/platform/ssl_pm.c index 5545f958e..cd9960da1 100755 --- a/components/openssl/platform/ssl_pm.c +++ b/components/openssl/platform/ssl_pm.c @@ -154,7 +154,11 @@ int ssl_pm_new(SSL *ssl) } if (ssl->ctx->ssl_alpn.alpn_status == ALPN_ENABLE) { - mbedtls_ssl_conf_alpn_protocols( &ssl_pm->conf, ssl->ctx->ssl_alpn.alpn_list ); +#ifdef MBEDTLS_SSL_ALPN + mbedtls_ssl_conf_alpn_protocols( &ssl_pm->conf, ssl->ctx->ssl_alpn.alpn_list ); +#else + SSL_DEBUG(SSL_PLATFORM_ERROR_LEVEL, "CONFIG_MBEDTLS_SSL_ALPN must be enabled to use ALPN", -1); +#endif // MBEDTLS_SSL_ALPN } mbedtls_ssl_conf_rng(&ssl_pm->conf, mbedtls_ctr_drbg_random, &ssl_pm->ctr_drbg);