Skip to content

Commit

Permalink
Add extra debug information in case of TLS handshake failure. (#357)
Browse files Browse the repository at this point in the history
* Add extra debug information in case of TLS handshake failure.
  • Loading branch information
beldmit authored Mar 1, 2024
1 parent 38c1f30 commit 6dab036
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/tlstest_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@ int create_bare_tls_connection(SSL *serverssl, SSL *clientssl, int want,
}

if (!clienterr && retc <= 0 && err != SSL_ERROR_WANT_READ) {
fprintf(stderr, "SSL_connect() failed %d, %d", retc, err);
fprintf(stderr,
"SSL_connect() failed returning %d, SSL error %d.\n", retc,
err);
ERR_print_errors_fp(stderr);
if (want != SSL_ERROR_SSL)
ERR_clear_error();
clienterr = 1;
Expand All @@ -165,7 +168,9 @@ int create_bare_tls_connection(SSL *serverssl, SSL *clientssl, int want,

if (!servererr && rets <= 0 && err != SSL_ERROR_WANT_READ
&& err != SSL_ERROR_WANT_X509_LOOKUP) {
fprintf(stderr, "SSL_accept() failed %d, %d", rets, err);
fprintf(stderr, "SSL_accept() failed returning %d, SSL error %d.\n",
rets, err);
ERR_print_errors_fp(stderr);
if (want != SSL_ERROR_SSL)
ERR_clear_error();
servererr = 1;
Expand Down

0 comments on commit 6dab036

Please sign in to comment.