mirror of
https://github.com/apache/httpd.git
synced 2025-08-08 15:02:10 +03:00
mod_ssl: Log private key material to file set by $SSLKEYLOGFILE in the
environment, using the standard format which can be parsed by (e.g.) wireshark for decoding SSL/TLS traffic; supported from OpenSSL 1.1.1. * modules/ssl/ssl_private.h: Add keylog_file to SSLModConfigRec. * modules/ssl/ssl_engine_init.c (ssl_init_Module): Open log file if SSLKEYLOGFILE is set in the environment. (ssl_init_ctx_protocol): Register the keylog callback with OpenSSL. * modules/ssl/ssl_engine_kernel.c (modssl_callback_keylog): New function. PR: 63391 Github: closes #74 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1869842 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -2803,3 +2803,17 @@ int ssl_callback_SRPServerParams(SSL *ssl, int *ad, void *arg)
|
||||
}
|
||||
|
||||
#endif /* HAVE_SRP */
|
||||
|
||||
|
||||
#ifdef HAVE_OPENSSL_KEYLOG
|
||||
/* Callback used with SSL_CTX_set_keylog_callback. */
|
||||
void modssl_callback_keylog(const SSL *ssl, const char *line)
|
||||
{
|
||||
conn_rec *conn = SSL_get_app_data(ssl);
|
||||
SSLSrvConfigRec *sc = mySrvConfig(conn->base_server);
|
||||
|
||||
if (sc && sc->mc->keylog_file) {
|
||||
apr_file_printf(sc->mc->keylog_file, "%s\n", line);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user