From c9cc28c0a118ff55a946b9461d0f49abb688046c Mon Sep 17 00:00:00 2001 From: Mehmet Yilmaz Date: Fri, 16 May 2025 14:43:42 +0000 Subject: [PATCH] Fix preprocessor conditionals for OpenSSL version checks in SSL setup functions --- src/backend/distributed/utils/enable_ssl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/backend/distributed/utils/enable_ssl.c b/src/backend/distributed/utils/enable_ssl.c index 4a1c3570e..6830d7058 100644 --- a/src/backend/distributed/utils/enable_ssl.c +++ b/src/backend/distributed/utils/enable_ssl.c @@ -245,7 +245,7 @@ CreateCertificatesWhenNeeded() * PostgreSQL itself will perform its full SSL setup when it reloads * its configuration with ssl enabled. */ -#if OPENSSL_VERSION_NUMBER >= 0x10100000L +#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000L /* OpenSSL 1.1.0+ */ OPENSSL_init_ssl(OPENSSL_INIT_LOAD_CONFIG, NULL); @@ -255,7 +255,7 @@ CreateCertificatesWhenNeeded() SSL_library_init(); #endif -#if OPENSSL_VERSION_NUMBER >= 0x10100000L +#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000L sslContext = SSL_CTX_new(TLS_method()); #else sslContext = SSL_CTX_new(SSLv23_method()); @@ -389,7 +389,7 @@ CreateCertificate(EVP_PKEY *privateKey) * would fail right after an upgrade. Instead of working until the certificate * expiration date and then suddenly erroring out. */ -#if OPENSSL_VERSION_NUMBER >= 0x10100000L +#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000L /* New mutable accessors (present in 1.1, 3.x). */ X509_gmtime_adj(X509_getm_notBefore(certificate), 0);