Skip to content

Commit

Permalink
Add extra debug information in case of TLS handshake failure. (open-q…
Browse files Browse the repository at this point in the history
…uantum-safe#357)

* Add extra debug information in case of TLS handshake failure.

Signed-off-by: Felipe Ventura <felipe.ventura@entrust.com>
  • Loading branch information
beldmit authored and feventura committed Mar 16, 2024
1 parent 2123377 commit d2cbde1
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 d2cbde1

Please sign in to comment.