From: Ben Greear Date: Thu, 7 Nov 2024 17:08:55 +0000 (+0100) Subject: vtls: fix compile warning when ALPN is not available X-Git-Tag: curl-8_11_1~109 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f6767e7a001aea9c1980c43d2c39921b2996860;p=thirdparty%2Fcurl.git vtls: fix compile warning when ALPN is not available Ref: https://curl.se/mail/lib-2024-11/0013.html Closes #15515 --- diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index e8be5d0ccd..f94e941b11 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -3674,14 +3674,14 @@ CURLcode Curl_ossl_ctx_init(struct ossl_ctx *octx, SSL_CTX_set_mode(octx->ssl_ctx, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER); #endif -#ifdef HAS_ALPN if(alpn && alpn_len) { +#ifdef HAS_ALPN if(SSL_CTX_set_alpn_protos(octx->ssl_ctx, alpn, (int)alpn_len)) { failf(data, "Error setting ALPN"); return CURLE_SSL_CONNECT_ERROR; } - } #endif + } if(ssl_cert || ssl_cert_blob || ssl_cert_type) { if(!result &&