Skip to content

Commit

Permalink
[XrdTls] Replace "#ifdef HAVE_TLS" with a version-based check
Browse files Browse the repository at this point in the history
This ensures that the right function is used with both shared and static
libraries, as CMake's check_symbol_exists() doesn't work with static
libraries. The release notes for OpenSSL 1.1.0 mention the deprecation
of the old function and recommends using the new TLS_method(). More
information at https://www.openssl.org/news/cl111.txt.
  • Loading branch information
amadio committed Nov 11, 2022
1 parent e3d11dc commit 49d1dd9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/XrdTls/XrdTlsContext.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <openssl/crypto.h>
#include <openssl/err.h>
#include <openssl/ssl.h>
#include <openssl/opensslv.h>
#include <sys/stat.h>

#include "XrdOuc/XrdOucUtils.hh"
Expand Down Expand Up @@ -429,7 +430,7 @@ void Fatal(std::string *eMsg, const char *msg, bool sslmsg=false)

const char *GetTlsMethod(const SSL_METHOD *&meth)
{
#ifdef HAVE_TLS
#if OPENSSL_VERSION_NUMBER > 0x1010000fL /* v1.1.0 */
meth = TLS_method();
#else
meth = SSLv23_method();
Expand Down

0 comments on commit 49d1dd9

Please sign in to comment.