]> git.kaiwu.me - haproxy.git/commit
MINOR: ssl: add alpn_remove_token() to drop a protocol from an ALPN string
authorWilly Tarreau <w@1wt.eu>
Mon, 12 Oct 2026 18:31:19 +0000 (18:31 +0000)
committerWilly Tarreau <w@1wt.eu>
Tue, 17 Nov 2026 10:08:46 +0000 (11:08 +0100)
commit94ab3dd9f6f47deb8ff1274178e589b953f2c42c
tree596afaaa2c47c06a1415712302e07556bed9b87f
parent933eeefc5f19b471851932170205611f0a8fca9a
MINOR: ssl: add alpn_remove_token() to drop a protocol from an ALPN string

This function removes all occurrences of a given protocol name from an
ALPN string in the binary form produced by ssl_sock_parse_alpn(), in
place, and updates its length. The string remains zero-terminated so that
the existing strstr() checks on it keep working, and it may end up empty,
which is then equivalent to "no-alpn". It returns the number of entries
removed.

It will be used by future patches to globally disable some protocols from
frontend ALPN strings at boot.
include/haproxy/ssl_utils.h
src/ssl_utils.c