diff --git a/libgearman/universal.cc b/libgearman/universal.cc index 03a03ce67..3426d9d06 100644 --- a/libgearman/universal.cc +++ b/libgearman/universal.cc @@ -473,7 +473,11 @@ bool gearman_universal_st::init_ssl() SSL_load_error_strings(); SSL_library_init(); - if ((_ctx_ssl= SSL_CTX_new(TLSv1_client_method())) == NULL) +#if (OPENSSL_VERSION_NUMBER < 0x10100000L) + if ((_ctx_ssl= SSL_CTX_new(TLSv1_2_client_method())) == NULL) +#else + if ((_ctx_ssl= SSL_CTX_new(TLS_client_method())) == NULL) +#endif { gearman_universal_set_error(*this, GEARMAN_INVALID_ARGUMENT, GEARMAN_AT, "CyaTLSv1_client_method() failed"); return false; diff --git a/util/instance.cc b/util/instance.cc index 4148733c4..207afa48c 100644 --- a/util/instance.cc +++ b/util/instance.cc @@ -125,7 +125,11 @@ bool Instance::init_ssl() SSL_load_error_strings(); SSL_library_init(); - if ((_ctx_ssl= SSL_CTX_new(TLSv1_client_method())) == NULL) +#if (OPENSSL_VERSION_NUMBER < 0x10100000L) + if ((_ctx_ssl= SSL_CTX_new(TLSv1_2_client_method())) == NULL) +#else + if ((_ctx_ssl= SSL_CTX_new(TLS_client_method())) == NULL) +#endif { _last_error= "SSL_CTX_new error"; return false;