From 0544c04a26c7c7e4b03dec6919e3783af01dcd4b Mon Sep 17 00:00:00 2001 From: Steven Schveighoffer Date: Thu, 7 Aug 2025 23:44:45 -0400 Subject: [PATCH 1/2] Add keylog callback support (added in openssl 1.1.1) --- source/deimos/openssl/ssl.di | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/source/deimos/openssl/ssl.di b/source/deimos/openssl/ssl.di index 1d5270c..8968fa4 100644 --- a/source/deimos/openssl/ssl.di +++ b/source/deimos/openssl/ssl.di @@ -1200,6 +1200,30 @@ auto SSL_want_x509_lookup()(const(SSL)* s) { return (SSL_want(s) == SSL_X509_LOO enum SSL_MAC_FLAG_READ_MAC_STREAM = 1; enum SSL_MAC_FLAG_WRITE_MAC_STREAM = 2; +static if (OPENSSL_VERSION_AT_LEAST(1, 1, 1)) +{ + /* + * A callback for logging out TLS key material. This callback should log out + * |line| followed by a newline. + */ + alias SSL_CTX_keylog_cb_func = ExternC!(void function( + const SSL *ssl, const char *line)); + + /* + * SSL_CTX_set_keylog_callback configures a callback to log key material. This + * is intended for debugging use with tools like Wireshark. The cb function + * should log line followed by a newline. + */ + void SSL_CTX_set_keylog_callback(SSL_CTX *ctx, SSL_CTX_keylog_cb_func cb); + + /* + * SSL_CTX_get_keylog_callback returns the callback configured by + * SSL_CTX_set_keylog_callback. + */ + SSL_CTX_keylog_cb_func SSL_CTX_get_keylog_callback(const SSL_CTX *ctx); +} + + version(OPENSSL_NO_SSL_INTERN) {} else { struct ssl_st From 913e75975f20f96ea750d630894d548f6fc9f66d Mon Sep 17 00:00:00 2001 From: Steven Schveighoffer Date: Thu, 7 Aug 2025 23:50:07 -0400 Subject: [PATCH 2/2] Try to resolve github CI failure. --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 38d166e..56d8b76 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,7 @@ jobs: steps: - name: 'Looking up cache' id: cache-openssl - uses: actions/cache@v1 + uses: actions/cache@v3 with: path: ${{ github.workspace }}/openssl/ key: ${{ runner.os }}-${{ runner.arch }}-${{ matrix.openssl.version }} @@ -114,7 +114,7 @@ jobs: # Restore or install build openssl version - name: 'Restore openssl from cache' id: lookup-openssl - uses: actions/cache@v1 + uses: actions/cache@v3 with: path: ${{ github.workspace }}/openssl/ key: ${{ runner.os }}-${{ runner.arch }}-${{ matrix.openssl.version }}