nghttpx: Call ERR_clear_error()
Call ERR_clear_error() before the OpenSSL function if we use SSL_get_error() to examine error stack.
This commit is contained in:
parent
9c1876f542
commit
ed1fad3bd4
|
@ -381,6 +381,8 @@ int Connection::tls_handshake() {
|
|||
break;
|
||||
}
|
||||
|
||||
ERR_clear_error();
|
||||
|
||||
auto rv = SSL_do_handshake(tls.ssl);
|
||||
|
||||
if (rv <= 0) {
|
||||
|
@ -615,6 +617,8 @@ ssize_t Connection::write_tls(const void *data, size_t len) {
|
|||
|
||||
tls.last_write_idle = -1.;
|
||||
|
||||
ERR_clear_error();
|
||||
|
||||
auto rv = SSL_write(tls.ssl, data, len);
|
||||
|
||||
if (rv <= 0) {
|
||||
|
@ -667,6 +671,8 @@ ssize_t Connection::read_tls(void *data, size_t len) {
|
|||
tls.last_readlen = 0;
|
||||
}
|
||||
|
||||
ERR_clear_error();
|
||||
|
||||
auto rv = SSL_read(tls.ssl, data, len);
|
||||
|
||||
if (rv <= 0) {
|
||||
|
|
Loading…
Reference in New Issue