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

tls: ensure using ssl before doing tls_shutdown

This commit is contained in:
caobug 2021-09-28 14:56:22 +08:00 committed by Andy Green
parent ee15b82b6e
commit 90eb83a307
2 changed files with 5 additions and 2 deletions

View file

@ -271,7 +271,9 @@ int
#endif
lws_tls_server_abort_connection(struct lws *wsi)
{
__lws_tls_shutdown(wsi);
if (wsi->tls.use_ssl)
__lws_tls_shutdown(wsi);
SSL_free(wsi->tls.ssl);
return 0;

View file

@ -682,7 +682,8 @@ lws_tls_server_new_nonblocking(struct lws *wsi, lws_sockfd_type accept_fd)
int
lws_tls_server_abort_connection(struct lws *wsi)
{
SSL_shutdown(wsi->tls.ssl);
if (wsi->tls.use_ssl)
SSL_shutdown(wsi->tls.ssl);
SSL_free(wsi->tls.ssl);
return 0;