/** * @file proxysql_sslkeylog.h * @brief SSL/TLS key logging support for ProxySQL * * This module implements SSL/TLS key logging functionality, which allows * decryption of encrypted traffic by tools like Wireshark. The key log file * contains the secrets needed to decrypt TLS 1.2 and TLS 1.3 connections. * * SECURITY WARNING: The key log file contains sensitive cryptographic secrets * that can decrypt all SSL/TLS traffic. Access to this file should be tightly * controlled. This feature should only be enabled for debugging purposes. * * @see https://wiki.wireshark.org/TLS#TLS_Decryption * @see https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/Key_Log_Format */ #ifndef __PROXYSQL_SSLKEYLOG_H #define __PROXYSQL_SSLKEYLOG_H #include "proxysql.h" /** * @brief Initialize the SSL keylog subsystem * * Must be called once at ProxySQL startup to initialize the rwlock * that protects concurrent access to the keylog file. * * Thread-safety: Safe */ void proxysql_keylog_init(); /** * @brief Open and initialize the SSL keylog file * * Opens the specified file in append mode with line buffering. * If a keylog file is already open, it is closed first. * * The keylog file format follows the NSS Key Log Format: *