]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
vtls: fix compile warning when ALPN is not available
authorBen Greear <greearb@candelatech.com>
Thu, 7 Nov 2024 17:08:55 +0000 (18:08 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 7 Nov 2024 22:48:32 +0000 (23:48 +0100)
Ref: https://curl.se/mail/lib-2024-11/0013.html

Closes #15515

lib/vtls/openssl.c

index e8be5d0ccd91048ffd3e6aa41a81ca0ce3c1e767..f94e941b11b00ec8ab35d4075ca749976e36d26f 100644 (file)
@@ -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 &&