1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

ssl client certs fix crash

I run a web socket server that requires clients to present a certificate.

context_ssl_ = libwebsocket_create_context(wssPort_, wssIpAddr_.c_str(), protocols_ssl,

                           libwebsocket_internal_extensions,

                           cert_path.c_str(), key_path.c_str(), -1, -1,

		LWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT);

I am getting a crash in the OpenSSL_verify_callback().

The SSL_get_ex_data() call is returning NULL

I could not find a call to SSL_set_ex_data() for server mode operation.

Has anyone seen this crash in the newer versions?

Signed-off-by: Larry Hayes <larry.hayes@prodeasystems.com>
This commit is contained in:
Larry Hayes 2013-01-15 01:03:58 +08:00 committed by Andy Green
parent 24b588b6d9
commit 455d1fed06

View file

@ -1593,8 +1593,6 @@ libwebsocket_service_fd(struct libwebsocket_context *context,
break;
}
/* accepting connection to main listener */
new_wsi = libwebsocket_create_new_server_wsi(context);
if (new_wsi == NULL) {
#ifdef WIN32
@ -1628,6 +1626,9 @@ libwebsocket_service_fd(struct libwebsocket_context *context,
break;
}
SSL_set_ex_data(new_wsi->ssl,
openssl_websocket_private_data_index, context);
SSL_set_fd(new_wsi->ssl, accept_fd);
n = SSL_accept(new_wsi->ssl);