Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use cmake to determine the existence of openssl funcs. Ignore the openssl constants #358

Merged
merged 2 commits into from
Apr 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 16 additions & 0 deletions cmake/FindOpenSSL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,19 @@ else()

mark_as_advanced( OPENSSL_INCLUDE_DIR OPENSSL_LIBRARIES )
endif()


#-------------------------------------------------------------------------------
# Check for the TLS support in the OpenSSL version that is available
#-------------------------------------------------------------------------------

set ( CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES} )

check_function_exists(TLSv1_2_method HAVE_TLS12)
compiler_define_if_found(HAVE_TLS12 HAVE_TLS12)

check_function_exists(TLSv1_1_method HAVE_TLS11)
compiler_define_if_found(HAVE_TLS11 HAVE_TLS11)

check_function_exists(TLSv1_method HAVE_TLS1)
compiler_define_if_found(HAVE_TLS1 HAVE_TLS1)
2 changes: 2 additions & 0 deletions cmake/XRootDSystemCheck.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,5 @@ if ( EnableAtomicsIfPresent )
compiler_define_if_found( HAVE_ATOMICS HAVE_ATOMICS )
endif ()



2 changes: 1 addition & 1 deletion src/XrdHttp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if( BUILD_HTTP )
# The XrdHttp library
#-----------------------------------------------------------------------------
include_directories( ${OPENSSL_INCLUDE_DIR} )

add_library(
${LIB_XRD_HTTP}
MODULE
Expand Down
12 changes: 6 additions & 6 deletions src/XrdHttp/XrdHttpProtocol.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1322,17 +1322,17 @@ int XrdHttpProtocol::InitSecurity() {

const SSL_METHOD *meth;

#ifdef TLS1_2_VERSION
#ifdef HAVE_TLS12
meth = TLSv1_2_method();
eDest.Say(" Using TLS 1.2");
#elif TLS1_1_VERSION
eDest.Say(" Using deprecated TLS version 1.1.")
#elif defined (HAVE_TLS11)
eDest.Say(" Using deprecated TLS version 1.1.");
meth = TLSv1_1_method();
#elif TLS1_VERSION
eDest.Say(" Using deprecated TLS version 1.")
#elif defined (HAVE_TLS1)
eDest.Say(" Using deprecated TLS version 1.");
meth = TLSv1_method();
#else
eDest.Say(" warning: TLS is not available, falling back to SSL23 (deprecated).")
eDest.Say(" warning: TLS is not available, falling back to SSL23 (deprecated).");
meth = SSLv23_method();
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/XrdHttp/xrootd-http.cf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ http.cadir /etc/grid-security/certificates
# Usual basic xrd stuff
#
all.role server
all.manager pcitsdcfab.cern.ch:1213
all.manager <your_manager_host>:1213
all.export /
oss.localroot /tmp/xrdroot