mirror of https://github.com/citusdata/citus.git
Refactor SSL context creation to use TLS_method for OpenSSL 1.1.0+ compatibility
parent
6e449db893
commit
05432519e2
|
@ -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 "
|
||||||
|
@ -387,8 +392,8 @@ CreateCertificate(EVP_PKEY *privateKey)
|
||||||
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
|
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
|
||||||
|
|
||||||
/* New mutable accessors (present in 1.1, 3.x). */
|
/* New mutable accessors (present in 1.1, 3.x). */
|
||||||
X509_gmtime_adj(X509_getm_notBefore(certificate), 0);
|
X509_gmtime_adj(X509_getm_notBefore(certificate), 0);
|
||||||
X509_gmtime_adj(X509_getm_notAfter(certificate), 0);
|
X509_gmtime_adj(X509_getm_notAfter(certificate), 0);
|
||||||
#else
|
#else
|
||||||
|
|
||||||
/* Legacy functions kept for 1.0.x compatibility. */
|
/* Legacy functions kept for 1.0.x compatibility. */
|
||||||
|
|
Loading…
Reference in New Issue