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 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
..
lws-genaes.c gencrypto: aes: improve test key now openssl checks it 2019-07-14 15:46:47 -07:00
lws-gencrypto.c genhash: add MD5 2019-07-17 13:09:40 -07:00
lws-genec.c openssl: rename internal api for describe error stack and make it destructive again 2019-07-13 13:28:44 -07:00
lws-genhash.c COV225133: coverity false positive 2019-09-17 09:25:18 +01:00
lws-genrsa.c openssl: rename internal api for describe error stack and make it destructive again 2019-07-13 13:28:44 -07:00
openssl-client.c openssl: handle negotiation errors handling in client 2019-12-19 21:32:31 +00:00
openssl-server.c lws_dll: upgrade all instances to lws_dll2 2019-08-08 16:58:55 +01:00
private.h lws_dll: upgrade all instances to lws_dll2 2019-08-08 16:58:55 +01:00
ssl.c stats: move to pt and improve presentation 2019-08-12 06:18:04 +01:00
tls.c openssl: add threading apis needed for 1.0.2 and earlier 2019-08-02 09:47:23 +01:00
x509.c fix integer conversions from 64 bit 2019-10-27 16:38:54 +00:00