mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
ssl: fix segfault when using SSL_CTX that is not created
vhost->ssl_ctx is created in 'lws_tls_server_vhost_backend_init', but it is used before in 'lws_tls_server_client_cert_verify_config' when calling SSL_CTX_set_session_id_context... Signed-off-by: Petar Paradzik <petar.paradzik@sartura.hr>
This commit is contained in:
parent
5a90bb36d1
commit
413631632b
1 changed files with 2 additions and 2 deletions
|
@ -73,8 +73,6 @@ lws_context_init_server_ssl(struct lws_context_creation_info *info,
|
|||
* as a server, if we are requiring clients to identify themselves
|
||||
* then set the backend up for it
|
||||
*/
|
||||
lws_tls_server_client_cert_verify_config(info, vhost);
|
||||
|
||||
if (lws_check_opt(info->options,
|
||||
LWS_SERVER_OPTION_ALLOW_NON_SSL_ON_SSL_PORT))
|
||||
/* Normally SSL listener rejects non-ssl, optionally allow */
|
||||
|
@ -88,6 +86,8 @@ lws_context_init_server_ssl(struct lws_context_creation_info *info,
|
|||
if (lws_tls_server_vhost_backend_init(info, vhost, &wsi))
|
||||
return -1;
|
||||
|
||||
lws_tls_server_client_cert_verify_config(info, vhost);
|
||||
|
||||
vhost->protocols[0].callback(&wsi,
|
||||
LWS_CALLBACK_OPENSSL_LOAD_EXTRA_SERVER_VERIFY_CERTS,
|
||||
vhost->ssl_ctx, NULL, 0);
|
||||
|
|
Loading…
Add table
Reference in a new issue