diff options
author | Jeremy Harris <jgh146exb@wizmail.org> | 2018-12-30 22:51:18 +0000 |
---|---|---|
committer | Jeremy Harris <jgh146exb@wizmail.org> | 2018-12-30 22:51:18 +0000 |
commit | 3c1f3b85aa4139ba062268ca958bab0dd0d64140 (patch) | |
tree | 9de99a26ee250257293ff5b7c6dbac7c54bfa074 /src | |
parent | 190404d75c168ce1e6dbf6ee08bdbbf62b365e4b (diff) |
OpenSSL: Debug output TLS 1.3 keying
Diffstat (limited to 'src')
-rw-r--r-- | src/src/tls-openssl.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/src/tls-openssl.c b/src/src/tls-openssl.c index 8f888824f..692022063 100644 --- a/src/src/tls-openssl.c +++ b/src/src/tls-openssl.c @@ -91,6 +91,12 @@ change this guard and punt the issue for a while longer. */ # endif #endif +#ifndef LIBRESSL_VERSION_NUMBER +# if OPENSSL_VERSION_NUMBER >= 0x010101000L +# define OPENSSL_HAVE_KEYLOG_CB +# endif +#endif + #if !defined(EXIM_HAVE_OPENSSL_TLSEXT) && !defined(DISABLE_OCSP) # warning "OpenSSL library version too old; define DISABLE_OCSP in Makefile" # define DISABLE_OCSP @@ -774,6 +780,12 @@ DEBUG(D_tls) } } +static void +keylog_callback(const SSL *ssl, const char *line) +{ +DEBUG(D_tls) debug_printf("%.200s\n", line); +} + /************************************************* @@ -1768,6 +1780,9 @@ if (!RAND_status()) level. */ DEBUG(D_tls) SSL_CTX_set_info_callback(ctx, (void (*)())info_callback); +#ifdef OPENSSL_HAVE_KEYLOG_CB +DEBUG(D_tls) SSL_CTX_set_keylog_callback(ctx, (void (*)())keylog_callback); +#endif /* Automatically re-try reads/writes after renegotiation. */ (void) SSL_CTX_set_mode(ctx, SSL_MODE_AUTO_RETRY); |