Refactor SSL context creation to use TLS_method for OpenSSL 1.1.0+ compatibility

m3hm3t/pg18_rel_oid_2
Mehmet Yilmaz 2025-05-16 14:35:36 +00:00
parent 6e449db893
commit 05432519e2
1 changed files with 7 additions and 2 deletions

View File

@ -255,7 +255,12 @@ CreateCertificatesWhenNeeded()
SSL_library_init(); SSL_library_init();
#endif #endif
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
sslContext = SSL_CTX_new(TLS_method()); sslContext = SSL_CTX_new(TLS_method());
#else
sslContext = SSL_CTX_new(SSLv23_method());
#endif
if (!sslContext) if (!sslContext)
{ {
ereport(WARNING, (errmsg("unable to create ssl context, please verify ssl " ereport(WARNING, (errmsg("unable to create ssl context, please verify ssl "