Opened 8 months ago

Last modified 7 months ago

#2135 new enhancement

capture negotiated ssl_curve

Reported by: Geert Hendrickx Owned by:
Priority: minor Milestone:
Component: documentation Version: 1.19.x
Keywords: ssl, logging Cc:
uname -a:
nginx -V: nginx version: nginx/1.19.6

Description (last modified by Geert Hendrickx)

$ssl_ciphers contains the list of ciphers offered/supported by the client.
$ssl_cipher contains the one cipher selected by the server, from the above list of client ciphers.

$ssl_curves contains the list of elliptic curves offered/supported by the client.
However there is no $ssl_curve counterpart to log the selected curve.

Like $ssl_cipher, this could be useful for analysis and optimization of the SSL configuration.

Change History (3)

comment:1 by Geert Hendrickx, 8 months ago

Description: modified (diff)

comment:2 by Maxim Dounin, 7 months ago

While it might be interesting, it seems that OpenSSL currently provides no easy way to obtain the curve used during ECDH key exchange for the connection, at least not on the server side. While SSL_get_peer_tmp_key(), introduced in the OpenSSL 1.1.1 branch, expected to make it available on the server side, it seems to return something only when using TLSv1.3, much like SSL_get_peer_tmp_key(). Further, I would expect problems after session resumption, as the information about the curve used during handshake isn't stored into session data.

That is, more or less the only information we have is SSL_get_shared_curve(), which is not the curve used during the handshake, but rather a curve which would be used for ECDH key exchange given the list of curves provided by the client ($ssl_curves) and server settings (ssl_ecdh_curves, prefer_server_ciphers). I tend to think that such a variable would be misleading, since it will have a value even if ECDH key exchange is not used. Further, it can be trivially derived from $ssl_curves and server configuration, so hardly adds anything new.

comment:3 by Geert Hendrickx, 7 months ago

Thanks for your thoughts. We'll derive it from $ssl_curves like you suggested.

Note: See TracTickets for help on using tickets.