let us prepare for using OpenSSL-3.0.0 in no deprecation mode --- include/haproxy/openssl-compat.h | 7 +++++++ src/ssl_sock.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/include/haproxy/openssl-compat.h b/include/haproxy/openssl-compat.h index 17d073d51..1b7272636 100644 --- a/include/haproxy/openssl-compat.h +++ b/include/haproxy/openssl-compat.h @@ -41,6 +41,13 @@ #define OpenSSL_version_num SSLeay #endif +/* ERR_func_error_string is deprecated in OpenSSL-3.0.0 */ +#if (OPENSSL_VERSION_NUMBER >= 0x30000000L) +#define HA_ERR_func_error_string(ret) "OPENSSL_internal" +#else +#define HA_ERR_func_error_string(ret) ERR_func_error_string(ret) +#endif + #if (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER >= 0x2070100fL) || defined(OPENSSL_IS_BORINGSSL) || (!defined(LIBRESSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >= 0x10100000L)) #define HAVE_SSL_EXTRACT_RANDOM #endif diff --git a/src/ssl_sock.c b/src/ssl_sock.c index 8be8c6fde..a7505e5a9 100644 --- a/src/ssl_sock.c +++ b/src/ssl_sock.c @@ -606,7 +606,7 @@ static forceinline void ssl_sock_dump_errors(struct connection *conn) return; fprintf(stderr, "fd[%#x] OpenSSL error[0x%lx] %s: %s\n", conn->handle.fd, ret, - ERR_func_error_string(ret), ERR_reason_error_string(ret)); + HA_ERR_func_error_string(ret), ERR_reason_error_string(ret)); } } } -- 2.29.2.windows.2