Skip to content

Commit

Permalink
Merge pull request #875 from paullouisageneau/fix-eof-check-openssl
Browse files Browse the repository at this point in the history
Fix incorrect check concealing failures with OpenSSL
  • Loading branch information
paullouisageneau authored May 4, 2023
2 parents 10eed72 + a793023 commit c39e9f8
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/impl/tls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,12 @@ bool check(int success, const string &message) {
}

bool check(SSL *ssl, int ret, const string &message) {
if (ret == BIO_EOF)
return true;

unsigned long err = SSL_get_error(ssl, ret);
if (err == SSL_ERROR_NONE || err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE) {
return true;
}
if (err == SSL_ERROR_ZERO_RETURN) {
PLOG_DEBUG << "DTLS connection cleanly closed";
PLOG_DEBUG << "OpenSSL connection cleanly closed";
return false;
}
string str = error_string(err);
Expand Down

0 comments on commit c39e9f8

Please sign in to comment.