1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-16 00:00:07 +01:00
libwebsockets/lib/tls
Wojtek Kaniewski fd70c1ac81 openssl: handle negotiation errors handling in client
If a client connects to a SSL server and the server sends handshake
alert (e.g. no matching ciphers) SSL_connect() fails, but because
SSL_ERROR_SSL return value is not handled, it's not considered a
failure. SSL_want_read() will return 1 and the client will happily wait
for more data from the server. Now if the server closes connection after
sending handshake alert, POLLIN event will be triggered,
lws_tls_client_connect() called again, but SSL_connect() will fail
without calling read(), so the client will end up consuming 100% CPU
because POLLIN will be triggered repeatedly.

Similar error handling is used in lws_tls_server_accept() and the
condition checks for SSL_ERROR_SSL. Using the same condition in
lws_tls_client_connect() fixes the problem.

Tested with OpenSSL 1.0.2k.
2019-12-19 21:32:31 +00:00
..
mbedtls mbedtls: cast ecdh enum type for some toolchains 2019-11-27 07:43:55 +00:00
openssl openssl: handle negotiation errors handling in client 2019-12-19 21:32:31 +00:00
lws-gencrypto-common.c genhash: add MD5 2019-07-17 13:09:40 -07:00
lws-genec-common.c old openssl: dont build with membuffer apis 2019-03-12 11:57:43 +08:00
private-network.h sul: all timed objects use a single pt sul list 2019-08-09 10:12:09 +01:00
private.h openssl: add threading apis needed for 1.0.2 and earlier 2019-08-02 09:47:23 +01:00
tls-client.c http_proxy: fix for mbedtls 2019-11-15 09:15:37 +00:00
tls-network.c sul: all timed objects use a single pt sul list 2019-08-09 10:12:09 +01:00
tls-server.c stats: move to pt and improve presentation 2019-08-12 06:18:04 +01:00
tls.c pem_to_der: fix binary mode length handling 2019-09-16 18:19:36 +01:00