---
name: "libressl-SSL_CTX_set_keylog_callback"
section: "3"
platform: "linux"
package: "libressl"
version: "4.4.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/libressl-SSL_CTX_set_keylog_callback"
---

# libressl-SSL\_CTX\_set\_keylog\_callback(3)

set and get the unused key logging callback

## NAME

**SSL\_CTX\_set\_keylog\_callback**, **SSL\_CTX\_get\_keylog\_callback** – set and get the unused key logging callback

## SYNOPSIS

SSL Library (libssl, -lssl) libcrypto

**#include \<openssl/ssl.h\>**

*typedef* *void*\

**(\*SSL\_CTX\_keylog\_cb\_func)**(*const SSL \*ssl*, *const char \*line*);

*void*\

**SSL\_CTX\_set\_keylog\_callback**(*SSL\_CTX \*ctx*, *SSL\_CTX\_keylog\_cb\_func cb*);

*SSL\_CTX\_keylog\_cb\_func*\

**SSL\_CTX\_get\_keylog\_callback**(*const SSL\_CTX \*ctx*);

## DESCRIPTION

**SSL\_CTX\_set\_keylog\_callback**() sets the TLS key logging callback. This callback is never called in LibreSSL.

**SSL\_CTX\_get\_keylog\_callback**() retrieves the previously set TLS key logging callback.

These functions are provided only for compatibility with OpenSSL.

## RETURN VALUES

**SSL\_CTX\_get\_keylog\_callback**() returns the previously set TLS key logging callback, or NULL if no callback has been set.

## SEE ALSO

[ssl(3)](/ssl/3.md), SSL\_CTX\_new(3)

## HISTORY

These functions first appeared in OpenSSL 1.1.1 and have been available since OpenBSD 7.1.
