Skip to content

Commit

Permalink
Merge pull request gearman#228 from illuusio/openssl_1_1
Browse files Browse the repository at this point in the history
OpenSSL 1.1 deprecates function 'TLSv1_2_client_method'
  • Loading branch information
SpamapS authored Dec 17, 2018
2 parents 5638433 + 2321374 commit 64716ae
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion libgearman/universal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 5 additions & 1 deletion util/instance.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 64716ae

Please sign in to comment.