1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-16 00:00:07 +01:00
libwebsockets/lib/tls/openssl
Wojtek Kaniewski ea50c8722c 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:30:09 +00:00
..
lws-genaes.c freertos: rename esp32 plat to freertos 2019-08-26 09:58:57 +01:00
lws-gencrypto.c private.h: rename to contain dir 2019-08-15 10:49:52 +01:00
lws-genec.c private.h: rename to contain dir 2019-08-15 10:49:52 +01:00
lws-genhash.c COV225133: coverity false positive 2019-09-22 03:08:36 -07:00
lws-genrsa.c private.h: rename to contain dir 2019-08-15 10:49:52 +01:00
openssl-client.c openssl: handle negotiation errors handling in client 2019-12-19 21:30:09 +00:00
openssl-server.c acme: add wildcard support to CSR 2019-11-06 16:02:36 +00:00
openssl-ssl.c detailed latency stats 2019-09-22 03:06:59 -07:00
openssl-tls.c private.h: rename to contain dir 2019-08-15 10:49:52 +01:00
openssl-x509.c fix integer conversions from 64 bit 2019-10-27 16:29:04 +00:00
private-lib-tls-openssl.h semmle: fix warnings 2019-09-22 09:35:07 -07:00