Skip to content

Commit

Permalink
openssl: Add lws ctx ref to client vhost's SSL_CTX
Browse files Browse the repository at this point in the history
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 <marty.flickinger@garmin.com>
Signed-off-by: Marty Flickinger <marty.flickinger@garmin.com>
Signed-off-by: Nate Karstens <nate.karstens@garmin.com>
  • Loading branch information
2 people authored and lws-team committed Oct 24, 2023
1 parent a1cbc02 commit d4c9158
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/tls/openssl/openssl-client.c
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,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");
Expand Down

0 comments on commit d4c9158

Please sign in to comment.