Skip to content

Commit

Permalink
tls: print openssl error queue if accept failed (#367)
Browse files Browse the repository at this point in the history
  • Loading branch information
alfredh authored May 15, 2022
1 parent e545b0d commit 4b1b27f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/tls/openssl/tls_tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,6 @@ static int tls_accept(struct tls_conn *tc)
if (r <= 0) {
const int ssl_err = SSL_get_error(tc->ssl, r);

ERR_clear_error();

switch (ssl_err) {

case SSL_ERROR_WANT_READ:
Expand All @@ -186,9 +184,12 @@ static int tls_accept(struct tls_conn *tc)
default:
DEBUG_WARNING("accept error: (r=%d, ssl_err=%d)\n",
r, ssl_err);
tls_flush_error();
err = EPROTO;
break;
}

ERR_clear_error();
}

return err;
Expand Down

0 comments on commit 4b1b27f

Please sign in to comment.