summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2020-03-20 11:58:34 +0000
committerMatt Caswell <matt@openssl.org>2020-03-30 14:39:29 +0100
commite737adb42a641a33ee73031639c989dfb1283926 (patch)
tree4c0bf8610bd02080c9f56880a082d92b257ceb99
parent20c98cd45399423f760dbd75d8912769c6b7b10e (diff)
Display errors if a test TLS connection fails
If a connection fails it is useful during debugging to have any errors that are on the OpenSSL error stack at the time of the failure. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Ben Kaduk <kaduk@mit.edu> (Merged from https://github.com/openssl/openssl/pull/11406)
-rw-r--r--test/ssltestlib.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ssltestlib.c b/test/ssltestlib.c
index 66d4e9b3a0..4ecfb4a14c 100644
--- a/test/ssltestlib.c
+++ b/test/ssltestlib.c
@@ -938,6 +938,8 @@ int create_bare_ssl_connection(SSL *serverssl, SSL *clientssl, int want,
if (!clienterr && retc <= 0 && err != SSL_ERROR_WANT_READ) {
TEST_info("SSL_connect() failed %d, %d", retc, err);
+ if (want != SSL_ERROR_SSL)
+ TEST_openssl_errors();
clienterr = 1;
}
if (want != SSL_ERROR_NONE && err == want)
@@ -954,6 +956,8 @@ int create_bare_ssl_connection(SSL *serverssl, SSL *clientssl, int want,
&& err != SSL_ERROR_WANT_READ
&& err != SSL_ERROR_WANT_X509_LOOKUP) {
TEST_info("SSL_accept() failed %d, %d", rets, err);
+ if (want != SSL_ERROR_SSL)
+ TEST_openssl_errors();
servererr = 1;
}
if (want != SSL_ERROR_NONE && err == want)