From 6aa30a9367ed816434ed28c2ddb01271ca882f1c Mon Sep 17 00:00:00 2001 From: Andrew Hopkins Date: Thu, 2 Jan 2025 11:02:29 -0800 Subject: [PATCH] Add more logging for SSL_ERROR_SYSCALL errors in bssl_shim.cc (#2079) ### Issues: Addresses V1370176317 ### Description of changes: Attempt to get more information about SSL test failures. In the event of [SSL_ERROR_SYSCALL](https://github.com/aws/aws-lc/blob/main/include/openssl/ssl.h#L578-L583) errno might have more information about the issue. ### Testing: I can't reproduce the failures locally, but hopefully this prints more information that might help. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license. --- ssl/test/bssl_shim.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ssl/test/bssl_shim.cc b/ssl/test/bssl_shim.cc index 4e9956ad22..28010b8786 100644 --- a/ssl/test/bssl_shim.cc +++ b/ssl/test/bssl_shim.cc @@ -31,6 +31,7 @@ OPENSSL_MSVC_PRAGMA(warning(pop)) #endif #include +#include #ifndef __STDC_FORMAT_MACROS #define __STDC_FORMAT_MACROS @@ -986,6 +987,11 @@ static bool DoConnection(bssl::UniquePtr *out_session, int ssl_err = SSL_get_error(ssl.get(), -1); if (ssl_err != SSL_ERROR_NONE) { fprintf(stderr, "SSL error: %s\n", SSL_error_description(ssl_err)); + if (ssl_err == SSL_ERROR_SYSCALL) { + int err = errno; + fprintf(stderr, "Error occurred: errno = %d, description = %s\n", err, strerror(err)); + + } } return false; }