]> git.kaiwu.me - nginx.git/commit
SSL: add $ssl_sigalgs variable
authorVadim Zhestikov <v.zhestikov@f5.com>
Tue, 2 Jun 2026 15:02:17 +0000 (08:02 -0700)
committerVadimZhestikov <108960056+VadimZhestikov@users.noreply.github.com>
Thu, 4 Jun 2026 16:50:50 +0000 (09:50 -0700)
commit1c387799ca8eff23aea0166e97ebd8f4435839b1
treec6b7d3c8606d0f042dcb24479c5dc3abc26340a5
parentc5f2afd50e63c94f3696d2d18bdd79ac70643eec
SSL: add $ssl_sigalgs variable

The new $ssl_sigalgs variable lists all signature algorithms
advertised by the client in its ClientHello message,
colon-separated, in analogy to $ssl_ciphers and $ssl_curves.

On OpenSSL 4.0+, SSL_get0_sigalg() is used, which returns proper
TLS scheme names (e.g. "rsa_pkcs1_sha256", "ecdsa_secp256r1_sha256")
and falls back to "0xHHHH" hex for unknown schemes.

On OpenSSL 1.0.2+, SSL_get_sigalgs() is used.  Since OBJ_nid2sn()
on the combined psignhash NID is not injective across TLS
SignatureScheme codes (e.g. 0x0403 and 0x081a both yield
"ecdsa-with-SHA256"), raw SignatureScheme codes are reported to
avoid ambiguity and to match the hex fallback format of
SSL_get0_sigalg().

With older versions, as well as BoringSSL, LibreSSL, and AWS-LC,
the variable is empty.
src/event/ngx_event_openssl.c
src/event/ngx_event_openssl.h
src/http/modules/ngx_http_ssl_module.c
src/stream/ngx_stream_ssl_module.c