]> git.kaiwu.me - haproxy.git/commit
BUILD: ssl: ASN1_STRING_length() is deprecated since OpenSSL 4.1
authorWilliam Lallemand <wlallemand@haproxy.com>
Fri, 11 Sep 2026 10:04:30 +0000 (10:04 +0000)
committerWilliam Lallemand <wlallemand@haproxy.com>
Fri, 11 Sep 2026 10:26:41 +0000 (12:26 +0200)
commitc72ba29a621e405003ec718b396c6a83fd946eb7
tree20206d86462c3744f5121b1ff0bbf81a7321702d
parenta99e8dbdc672b723180a433b4215057236b0e0a8
BUILD: ssl: ASN1_STRING_length() is deprecated since OpenSSL 4.1

OpenSSL 4.1.0-alpha1 deprecates ASN1_STRING_length() in favor of
ASN1_STRING_get_length(), which only differs by returning a size_t
instead of an int. This breaks the build when warnings are fatal:

  src/ssl_sock.c:4655:9: error: 'ASN1_STRING_length' is deprecated: Since OpenSSL 4.1; use ASN1_STRING_get_length() [-Werror=deprecated-declarations]

Let's simply remap the old name on the new function when built with
OpenSSL 4.1 and above, all the call places being compatible with both
return types.

This could be backported to all versions where we want to support
OpenSSL 4.1.
include/haproxy/openssl-compat.h