Skip to content

Commit 6aa30a9

Browse files
authored
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.
1 parent 4243a79 commit 6aa30a9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ssl/test/bssl_shim.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ OPENSSL_MSVC_PRAGMA(warning(pop))
3131
#endif
3232

3333
#include <assert.h>
34+
#include <errno.h>
3435

3536
#ifndef __STDC_FORMAT_MACROS
3637
#define __STDC_FORMAT_MACROS
@@ -986,6 +987,11 @@ static bool DoConnection(bssl::UniquePtr<SSL_SESSION> *out_session,
986987
int ssl_err = SSL_get_error(ssl.get(), -1);
987988
if (ssl_err != SSL_ERROR_NONE) {
988989
fprintf(stderr, "SSL error: %s\n", SSL_error_description(ssl_err));
990+
if (ssl_err == SSL_ERROR_SYSCALL) {
991+
int err = errno;
992+
fprintf(stderr, "Error occurred: errno = %d, description = %s\n", err, strerror(err));
993+
994+
}
989995
}
990996
return false;
991997
}

0 commit comments

Comments
 (0)