diff --git a/src/backend/distributed/utils/enable_ssl.c b/src/backend/distributed/utils/enable_ssl.c index c30bee214..4a1c3570e 100644 --- a/src/backend/distributed/utils/enable_ssl.c +++ b/src/backend/distributed/utils/enable_ssl.c @@ -255,7 +255,12 @@ CreateCertificatesWhenNeeded() SSL_library_init(); #endif +#if OPENSSL_VERSION_NUMBER >= 0x10100000L sslContext = SSL_CTX_new(TLS_method()); +#else + sslContext = SSL_CTX_new(SSLv23_method()); +#endif + if (!sslContext) { ereport(WARNING, (errmsg("unable to create ssl context, please verify ssl " @@ -387,8 +392,8 @@ CreateCertificate(EVP_PKEY *privateKey) #if OPENSSL_VERSION_NUMBER >= 0x10100000L /* New mutable accessors (present in 1.1, 3.x). */ - X509_gmtime_adj(X509_getm_notBefore(certificate), 0); - X509_gmtime_adj(X509_getm_notAfter(certificate), 0); + X509_gmtime_adj(X509_getm_notBefore(certificate), 0); + X509_gmtime_adj(X509_getm_notAfter(certificate), 0); #else /* Legacy functions kept for 1.0.x compatibility. */