Skip to content
Permalink
Browse files
GEODE-6568: Use OpenSSL from local install (#465)
* Support OpenSSL 1.0.x and 1.1.x with compat header.
* Install openssl-devel package on RHEL
* Install libssl-dev package on Ubuntu
* Install OpenSSL and headers on Windows.
* Update BUILDING and Docker for Travis
  • Loading branch information
pivotal-jbarrett committed Mar 29, 2019
1 parent d516fa6 commit 24cbd3970f3108e32d70b69776824c0fef0a694c
Show file tree
Hide file tree
Showing 27 changed files with 193 additions and 147 deletions.
@@ -4,6 +4,7 @@
* [CMake 3.12](https://cmake.org/) or newer
* C++11 compiler *(see platform specific requirements)*
* [Doxygen 8.11](http://www.stack.nl/~dimitri/doxygen/download.html) *(for building source documentation)*
* [OpenSSL](https://www.openssl.org) *(for building source documentation)*
* [Apache Geode](http://geode.apache.org/releases/) binaries installed or available to link against

### Platform-Specific Prerequisites
@@ -338,7 +338,10 @@ set_target_properties(run-integration-tests PROPERTIES
FOLDER test-common
)

find_package(OpenSSL REQUIRED)

add_subdirectory(dependencies)
add_subdirectory(openssl-compat)
add_subdirectory(cppcache)
add_subdirectory(cryptoimpl)
add_subdirectory(dhimpl)
@@ -56,7 +56,7 @@ macro(generate_config INPUT TEMP OUTPUT)
)
endmacro()

foreach( lib OpenSSL::SSL SQLite::sqlite3 )
foreach( lib SQLite::sqlite3 )
get_target_property(runtime_path ${lib} INTERFACE_RUNTIME_DIR)
set(PATH ${PATH} ${runtime_path})
endforeach()
@@ -100,9 +100,6 @@ endif()
add_dependencies(${PROJECT_NAME} nuget-restore)

add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
$<SHELL_PATH:$<TARGET_GENEX_EVAL:OpenSSL::SSL,$<TARGET_PROPERTY:OpenSSL::SSL,INTERFACE_RUNTIME_DIR>>>
$<SHELL_PATH:$<TARGET_FILE_DIR:${PROJECT_NAME}>>
COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<SHELL_PATH:$<TARGET_FILE:cryptoImpl>>
$<$<CONFIG:Debug>:$<SHELL_PATH:$<TARGET_PDB_FILE:cryptoImpl>>>
@@ -76,7 +76,7 @@ macro(generate_config INPUT TEMP OUTPUT)
endmacro()

# Add lazy loaded shared library paths to test environment
foreach( lib OpenSSL::SSL SQLite::sqlite3 )
foreach( lib SQLite::sqlite3 )
get_target_property(library_path ${lib} INTERFACE_LIBRARY_DIR)
set(LD_LIBRARY_PATH ${LD_LIBRARY_PATH} ${library_path})
get_target_property(runtime_path ${lib} INTERFACE_RUNTIME_DIR)
@@ -21,7 +21,8 @@ add_library(cryptoImpl SHARED
DHImpl.cpp
Ssl.hpp
SSLImpl.hpp
SSLImpl.cpp)
SSLImpl.cpp
)

include(GenerateExportHeader)
generate_export_header(cryptoImpl)
@@ -37,6 +38,7 @@ set_target_properties(cryptoImpl PROPERTIES

target_link_libraries(cryptoImpl
PRIVATE
openssl-compat
ACE::ACE_SSL
_WarningsAsError
PUBLIC
@@ -17,6 +17,7 @@

#include "DHImpl.hpp"

#include <openssl-compat.h>
#include <openssl/aes.h>
#include <openssl/asn1.h>
#include <openssl/err.h>
@@ -16,7 +16,6 @@
project( ACE VERSION 6.5.3 LANGUAGES NONE )

set( SHA256 de20bdbfcbcf7d67836e9a2c0875e4eb348a1153e19b83392608330fec3c056a )
set( DEPENDS OpenSSL::SSL )

if ("SunOS" STREQUAL ${CMAKE_SYSTEM_NAME})
set( ACE_PLATFORM sunos5_sunc++ )
@@ -42,9 +41,8 @@ if (NOT DEFINED ACE_PLATFORM)
message( FATAL_ERROR "ACE_PLATFORM unset for ${CMAKE_SYSTEM_NAME}" )
endif()


set( OPENSSL_ROOT $<TARGET_PROPERTY:OpenSSL::SSL,INTERFACE_INCLUDE_DIRECTORIES>/.. )

find_package(OpenSSL REQUIRED)
set( OPENSSL_ROOT ${OPENSSL_INCLUDE_DIR}/.. )

if (${WIN32})
if (64 EQUAL ${BUILD_BITS})
@@ -19,7 +19,6 @@ project( dependencies LANGUAGES NONE )
find_package(Patch REQUIRED)

add_subdirectory( libxml2 )
add_subdirectory( openssl )
add_subdirectory( ACE )
add_subdirectory( boost )
add_subdirectory( sqlite )
@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

project( doxygen VERSION 1.8 LANGUAGES NONE )
project( doxygen VERSION 1.6 LANGUAGES NONE )
# used to compile documents

# Not a runtime requirement, so look for existing installation.

This file was deleted.

@@ -13,15 +13,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.

cmake_minimum_required(VERSION 3.10)
project(DHImpl LANGUAGES CXX)

file(GLOB_RECURSE SOURCES "*.cpp")

add_library(DHImpl SHARED ${SOURCES})
add_library(DHImpl SHARED
DHImpl.cpp
DHImpl.hpp
)

set_target_properties(DHImpl PROPERTIES
FOLDER cpp/test/integration)
FOLDER cpp/test/integration
)

include(GenerateExportHeader)
generate_export_header(DHImpl)
@@ -37,6 +38,7 @@ target_link_libraries(DHImpl
OpenSSL::Crypto
c++11
PRIVATE
openssl-compat
_WarningsAsError
)

@@ -20,9 +20,11 @@
* limitations under the License.
*/

#include <openssl/dh.h>
#include <openssl-compat.h>
#include <openssl/asn1t.h>
#include <openssl/dh.h>
#include <openssl/x509.h>

#include <string>
#include <vector>

@@ -22,6 +22,8 @@ RUN apt-get update && \
apt-get install -y \
libc++-dev \
libc++abi-dev \
libssl-dev \
zlib1g-dev \
clang-${CLANG_VERSION} \
clang-tidy-${CLANG_VERSION} \
clang-format-${CLANG_VERSION} \
@@ -30,8 +32,7 @@ RUN apt-get update && \
git \
graphviz \
openjdk-8-jdk \
wget \
zlib1g-dev && \
wget && \
rm -rf /var/lib/apt/lists/* && \
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${CLANG_VERSION} 999 && \
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-${CLANG_VERSION} 999 && \
@@ -0,0 +1,30 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

project(openssl-compat LANGUAGES CXX)

add_library(openssl-compat INTERFACE)

target_include_directories(openssl-compat
INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
)

find_package(OpenSSL COMPONENTS Crypto)

target_link_libraries(openssl-compat
INTERFACE
OpenSSL::Crypto
)

0 comments on commit 24cbd39

Please sign in to comment.