{
SSL *ssl;
int n;
- struct lws_vhost *vh;
- struct lws wsi;
+ struct lws *wsi;
ssl = X509_STORE_CTX_get_ex_data(x509_ctx,
SSL_get_ex_data_X509_STORE_CTX_idx());
* !!! nasty openssl requires the index to come as a library-scope
* static
*/
- vh = SSL_get_ex_data(ssl, openssl_websocket_private_data_index);
-
- /*
- * give him a fake wsi with context set, so he can use lws_get_context()
- * in the callback
- */
- memset(&wsi, 0, sizeof(wsi));
- wsi.vhost = vh;
- wsi.context = vh->context;
+ wsi = SSL_get_ex_data(ssl, openssl_websocket_private_data_index);
- n = vh->protocols[0].callback(&wsi,
+ n = wsi->vhost->protocols[0].callback(wsi,
LWS_CALLBACK_OPENSSL_PERFORM_CLIENT_CERT_VERIFICATION,
x509_ctx, ssl, preverify_ok);
}
SSL_set_ex_data(wsi->ssl,
- openssl_websocket_private_data_index, wsi->vhost);
+ openssl_websocket_private_data_index, wsi);
SSL_set_fd(wsi->ssl, accept_fd);
#endif