#1781·Nginx

Mail: log negotiated TLS parameters after a successful handshake

Author: kinugasaCreated Sep 20, 2026Updated Sep 30, 2026
Labelsenhancement

Feature Overview

The nginx mail module does not currently log the TLS parameters negotiated with a client.

I propose adding one info-level message after a successful TLS handshake:

[info] ... *10 SSL handshake completed, protocol: TLSv1.3, cipher: "TLS_AES_256_GCM_SHA384", group: "X25519", client: 127.0.0.1 using starttls, server: 127.0.0.1:1143

This would apply to IMAPS, POP3S, SMTPS, and their STARTTLS/STLS variants. The existing mail log context and connection ID would allow the message to be correlated with authentication and proxy activity.

The group field would be omitted when it is unavailable. No new directive is proposed; error_log info would control whether the message is emitted. Existing log messages would remain unchanged.

Alternatives Considered

Appending these attributes to client logged in was considered, but that would change an existing log format and would not cover TLS connections that do not complete authentication.

Additional Context

I have an implementation and tests available for this proposal.