Uncomplete SSL connections cause infinite loops

This could be reproduced for example using mysql client and only specifying a certificate but not a key

mysql -h 127.0.0.1 -P6033 --ssl-cert=file.pem
pull/3105/head
René Cannaò 6 years ago
parent 8c7b70a9c5
commit dee2306032

@ -562,6 +562,11 @@ int MySQL_Data_Stream::read_from_net() {
} else {
int ssl_ret=SSL_get_error(ssl, r);
if (ssl_ret!=SSL_ERROR_WANT_READ && ssl_ret!=SSL_ERROR_WANT_WRITE) shut_soft();
if (r==0 && revents==1) {
// revents returns 1 , but recv() returns 0 , so there is no data.
// Therefore the socket is already closed
shut_soft();
}
}
} else {
queue_w(queueIN,r);

Loading…
Cancel
Save