src: Clear OpenSSL error queue before SSL_shutdown
This commit is contained in:
parent
8f40bd4675
commit
473f1d71ff
|
@ -340,6 +340,7 @@ Http2Handler::~Http2Handler() {
|
||||||
nghttp2_session_del(session_);
|
nghttp2_session_del(session_);
|
||||||
if (ssl_) {
|
if (ssl_) {
|
||||||
SSL_set_shutdown(ssl_, SSL_RECEIVED_SHUTDOWN);
|
SSL_set_shutdown(ssl_, SSL_RECEIVED_SHUTDOWN);
|
||||||
|
ERR_clear_error();
|
||||||
SSL_shutdown(ssl_);
|
SSL_shutdown(ssl_);
|
||||||
}
|
}
|
||||||
auto loop = sessions_->get_loop();
|
auto loop = sessions_->get_loop();
|
||||||
|
|
|
@ -204,6 +204,7 @@ void Client::disconnect() {
|
||||||
ev_io_stop(worker->loop, &rev);
|
ev_io_stop(worker->loop, &rev);
|
||||||
if (ssl) {
|
if (ssl) {
|
||||||
SSL_set_shutdown(ssl, SSL_RECEIVED_SHUTDOWN);
|
SSL_set_shutdown(ssl, SSL_RECEIVED_SHUTDOWN);
|
||||||
|
ERR_clear_error();
|
||||||
SSL_shutdown(ssl);
|
SSL_shutdown(ssl);
|
||||||
SSL_free(ssl);
|
SSL_free(ssl);
|
||||||
ssl = nullptr;
|
ssl = nullptr;
|
||||||
|
|
|
@ -688,6 +688,7 @@ struct HttpClient {
|
||||||
|
|
||||||
if (ssl) {
|
if (ssl) {
|
||||||
SSL_set_shutdown(ssl, SSL_RECEIVED_SHUTDOWN);
|
SSL_set_shutdown(ssl, SSL_RECEIVED_SHUTDOWN);
|
||||||
|
ERR_clear_error();
|
||||||
SSL_shutdown(ssl);
|
SSL_shutdown(ssl);
|
||||||
SSL_free(ssl);
|
SSL_free(ssl);
|
||||||
ssl = nullptr;
|
ssl = nullptr;
|
||||||
|
|
|
@ -561,6 +561,7 @@ ClientHandler::~ClientHandler() {
|
||||||
if (ssl_) {
|
if (ssl_) {
|
||||||
SSL_set_app_data(ssl_, nullptr);
|
SSL_set_app_data(ssl_, nullptr);
|
||||||
SSL_set_shutdown(ssl_, SSL_RECEIVED_SHUTDOWN);
|
SSL_set_shutdown(ssl_, SSL_RECEIVED_SHUTDOWN);
|
||||||
|
ERR_clear_error();
|
||||||
SSL_shutdown(ssl_);
|
SSL_shutdown(ssl_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -195,6 +195,7 @@ int Http2Session::disconnect(bool hard) {
|
||||||
|
|
||||||
if (ssl_) {
|
if (ssl_) {
|
||||||
SSL_set_shutdown(ssl_, SSL_RECEIVED_SHUTDOWN);
|
SSL_set_shutdown(ssl_, SSL_RECEIVED_SHUTDOWN);
|
||||||
|
ERR_clear_error();
|
||||||
SSL_shutdown(ssl_);
|
SSL_shutdown(ssl_);
|
||||||
SSL_free(ssl_);
|
SSL_free(ssl_);
|
||||||
ssl_ = nullptr;
|
ssl_ = nullptr;
|
||||||
|
|
Loading…
Reference in New Issue