From 051dfbdb7da39015db887fcd87a923cea047c2ea Mon Sep 17 00:00:00 2001 From: Nate Karstens Date: Fri, 20 Oct 2023 13:25:09 -0500 Subject: [PATCH] openssl: Add lws ctx ref to client vhost's SSL_CTX Adds a reference to the libwebsockets context to the OpenSSL context used by the client vhost. This allows SSL info callbacks to work correctly for clients, like it currently does for servers. Co-authored-by: Marty Flickinger Signed-off-by: Marty Flickinger Signed-off-by: Nate Karstens --- lib/tls/openssl/openssl-client.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/tls/openssl/openssl-client.c b/lib/tls/openssl/openssl-client.c index 5926184ab..884ca0213 100644 --- a/lib/tls/openssl/openssl-client.c +++ b/lib/tls/openssl/openssl-client.c @@ -868,6 +868,10 @@ lws_tls_client_create_vhost_context(struct lws_vhost *vh, return 1; } + SSL_CTX_set_ex_data(vh->tls.ssl_client_ctx, + openssl_SSL_CTX_private_data_index, + (char *)vh->context); + lws_plat_vhost_tls_client_ctx_init(vh); tcr = lws_zalloc(sizeof(*tcr), "client ctx tcr");