From 9b4fa24909cd363a5952872e447d38d4025b4daa Mon Sep 17 00:00:00 2001 From: Andy Green Date: Sat, 8 Jul 2017 16:01:34 +0800 Subject: [PATCH] client: reject init_client_ssl more than once --- lib/ssl-client.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/ssl-client.c b/lib/ssl-client.c index e60f10aa..0c757385 100644 --- a/lib/ssl-client.c +++ b/lib/ssl-client.c @@ -459,6 +459,9 @@ int lws_context_init_client_ssl(struct lws_context_creation_info *info, if (!lws_check_opt(info->options, LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT)) return 0; + if (vhost->ssl_client_ctx) + return 0; + if (info->provided_client_ssl_ctx) { /* use the provided OpenSSL context if given one */ vhost->ssl_client_ctx = info->provided_client_ssl_ctx;