diff --git a/lib/tls/openssl/openssl-tls.c b/lib/tls/openssl/openssl-tls.c index 577acf357..3080d772d 100644 --- a/lib/tls/openssl/openssl-tls.c +++ b/lib/tls/openssl/openssl-tls.c @@ -97,8 +97,9 @@ lws_context_init_ssl_library(struct lws_context *cx, #endif #endif if (!lws_check_opt(info->options, LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT)) { - lwsl_cx_info(cx, " SSL disabled: no " - "LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT"); + if (!info->provided_client_ssl_ctx) + lwsl_cx_info(cx, " SSL disabled: no " + "LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT"); return 0; } diff --git a/lib/tls/tls-client.c b/lib/tls/tls-client.c index 5b29923f5..41dd1c740 100644 --- a/lib/tls/tls-client.c +++ b/lib/tls/tls-client.c @@ -138,9 +138,6 @@ int lws_context_init_client_ssl(const struct lws_context_creation_info *info, if (info->client_ssl_ca_filepath) ca_filepath = info->client_ssl_ca_filepath; - if (!lws_check_opt(info->options, LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT)) - return 0; - if (vhost->tls.ssl_client_ctx) return 0; @@ -155,6 +152,9 @@ int lws_context_init_client_ssl(const struct lws_context_creation_info *info, } #endif + if (!lws_check_opt(info->options, LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT)) + return 0; + if (lws_tls_client_create_vhost_context(vhost, info, cipher_list, ca_filepath, info->client_ssl_ca_mem,