From 6a55f448e2e3ad22d0e385f96109cd98e78b086a Mon Sep 17 00:00:00 2001 From: Sylvain Saunier Date: Sun, 18 Sep 2022 08:13:21 +0100 Subject: [PATCH] tls: alpn for client --- lib/tls/openssl/openssl-client.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/tls/openssl/openssl-client.c b/lib/tls/openssl/openssl-client.c index f8a64f15d..b4181721d 100644 --- a/lib/tls/openssl/openssl-client.c +++ b/lib/tls/openssl/openssl-client.c @@ -389,13 +389,15 @@ lws_ssl_client_bio_create(struct lws *wsi) defined(LWS_HAVE_SSL_get0_alpn_selected) if (wsi->a.vhost->tls.alpn) alpn_comma = wsi->a.vhost->tls.alpn; - if (wsi->stash) + if (wsi->stash) { alpn_comma = wsi->stash->cis[CIS_ALPN]; #if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2) - if (lws_hdr_copy(wsi, hostname, sizeof(hostname), - _WSI_TOKEN_CLIENT_ALPN) > 0) - alpn_comma = hostname; + } else { + if (lws_hdr_copy(wsi, hostname, sizeof(hostname), + _WSI_TOKEN_CLIENT_ALPN) > 0) + alpn_comma = hostname; #endif + } lwsl_info("%s client conn using alpn list '%s'\n", wsi->role_ops->name, alpn_comma);