This is an automated email from the ASF dual-hosted git repository.

mmerli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new 8e7e335  Enable SSL of LibCurl linked to C++ library (#3024)
8e7e335 is described below

commit 8e7e33517fede7271c7738582d3d0e115f9182e3
Author: massakam <massa...@yahoo-corp.jp>
AuthorDate: Wed Nov 21 15:12:55 2018 +0900

    Enable SSL of LibCurl linked to C++ library (#3024)
    
    * Enable SSL of LibCurl linked to C++ library
    
    * Update openssl versions
    
    * Update openssl to 1.1.0j
---
 pulsar-client-cpp/CMakeLists.txt     |  2 +-
 pulsar-client-cpp/docker/Dockerfile  | 28 ++++++++++++++++++----------
 pulsar-client-cpp/pkg/deb/Dockerfile | 25 +++++++++++++------------
 pulsar-client-cpp/pkg/rpm/Dockerfile | 25 ++++++++++++-------------
 4 files changed, 44 insertions(+), 36 deletions(-)

diff --git a/pulsar-client-cpp/CMakeLists.txt b/pulsar-client-cpp/CMakeLists.txt
index c29db9a..ca43634 100644
--- a/pulsar-client-cpp/CMakeLists.txt
+++ b/pulsar-client-cpp/CMakeLists.txt
@@ -198,10 +198,10 @@ set(COMMON_LIBS
   ${Boost_CHRONO_LIBRARY}
   ${Boost_DATE_TIME_LIBRARY}
   ${Boost_ATOMIC_LIBRARY}
+  ${CURL_LIBRARY_PATH}
   ${OPENSSL_LIBRARIES}
   ${ZLIB_LIBRARY_PATH}
   ${PROTOBUF_LIBRARIES}
-  ${CURL_LIBRARY_PATH}
   ${ADDITIONAL_LIBRARIES}
   ${LIB_JSON}
   dl
diff --git a/pulsar-client-cpp/docker/Dockerfile 
b/pulsar-client-cpp/docker/Dockerfile
index 8e7167c..1df8459 100644
--- a/pulsar-client-cpp/docker/Dockerfile
+++ b/pulsar-client-cpp/docker/Dockerfile
@@ -32,6 +32,14 @@ ENV PATH="/opt/python/${PYTHON_SPEC}/bin:${PATH}"
 
 RUN ln -s /opt/python/${PYTHON_SPEC}/include/python${PYTHON_VERSION}m 
/opt/python/${PYTHON_SPEC}/include/python${PYTHON_VERSION}
 
+# Perl (required for building OpenSSL)
+RUN curl -O -L https://www.cpan.org/src/5.0/perl-5.10.0.tar.gz && \
+    tar xvfz perl-5.10.0.tar.gz && \
+    cd perl-5.10.0 && \
+    ./configure.gnu --prefix=/usr/local/ && \
+    make && make install && \
+    rm -rf /perl-5.10.0.tar.gz /perl-5.10.0
+
 ####################################
 # These dependencies can be found in Ubuntu but they're not compiled with 
-fPIC,
 # so they cannot be statically linked into a shared library
@@ -46,12 +54,12 @@ RUN curl -O -L https://zlib.net/zlib-1.2.11.tar.gz && \
     rm -rf /zlib-1.2.11.tar.gz /zlib-1.2.11
 
 # Compile OpenSSL
-RUN curl -O -L 
https://github.com/openssl/openssl/archive/OpenSSL_1_0_2l.tar.gz && \
-    tar xvfz OpenSSL_1_0_2l.tar.gz && \
-    cd openssl-OpenSSL_1_0_2l/ && \
-    ./Configure -fPIC no-shared linux-x86_64 && \
+RUN curl -O -L 
https://github.com/openssl/openssl/archive/OpenSSL_1_1_0j.tar.gz && \
+    tar xvfz OpenSSL_1_1_0j.tar.gz && \
+    cd openssl-OpenSSL_1_1_0j/ && \
+    ./Configure -fPIC --prefix=/usr/local/ssl/ no-shared linux-x86_64 && \
     make && make install && \
-    rm -rf /OpenSSL_1_0_2l.tar.gz /openssl-OpenSSL_1_0_2l
+    rm -rf /OpenSSL_1_1_0j.tar.gz /openssl-OpenSSL_1_1_0j
 
 # Download and compile boost
 RUN curl -O -L 
https://dl.bintray.com/boostorg/release/1.68.0/source/boost_1_68_0.tar.gz && \
@@ -126,12 +134,12 @@ RUN curl -O -L  
https://github.com/open-source-parsers/jsoncpp/archive/1.8.0.tar
     rm -rf /1.8.0.tar.gz /jsoncpp-1.8.0
 
 # LibCurl
-RUN curl -O -L  
https://github.com/curl/curl/releases/download/curl-7_54_0/curl-7.54.0.tar.gz 
&& \
-    tar xvfz curl-7.54.0.tar.gz && \
-    cd curl-7.54.0 && \
-    CFLAGS=-fPIC ./configure && \
+RUN curl -O -L  
https://github.com/curl/curl/releases/download/curl-7_58_0/curl-7.58.0.tar.gz 
&& \
+    tar xvfz curl-7.58.0.tar.gz && \
+    cd curl-7.58.0 && \
+    CFLAGS=-fPIC ./configure --with-ssl=/usr/local/ssl/ && \
     make && make install && \
-    rm -rf /curl-7.54.0.tar.gz /curl-7.54.0
+    rm -rf /curl-7.58.0.tar.gz /curl-7.58.0
 
 RUN pip install twine
 
diff --git a/pulsar-client-cpp/pkg/deb/Dockerfile 
b/pulsar-client-cpp/pkg/deb/Dockerfile
index 7740728..117cbde 100644
--- a/pulsar-client-cpp/pkg/deb/Dockerfile
+++ b/pulsar-client-cpp/pkg/deb/Dockerfile
@@ -21,7 +21,7 @@
 
 FROM debian:9
 
-RUN apt-get update && \
+RUN apt-get update -y && \
      apt-get install -y curl g++ make python-dev \
                 libxml2-utils git
 
@@ -64,20 +64,21 @@ RUN curl -O -L 
https://github.com/madler/zlib/archive/v1.2.11.tar.gz && \
     make && make install && \
     rm -rf /zlib-1.2.11.tar.gz /zlib-1.2.11
 
-RUN curl -O -L 
https://github.com/openssl/openssl/archive/OpenSSL_1_1_0h.tar.gz && \
-    tar xvfz OpenSSL_1_1_0h.tar.gz && \
-    cd openssl-OpenSSL_1_1_0h/ && \
-    ./Configure -fPIC no-shared linux-x86_64 && \
+RUN curl -O -L 
https://github.com/openssl/openssl/archive/OpenSSL_1_1_0j.tar.gz && \
+    tar xvfz OpenSSL_1_1_0j.tar.gz && \
+    cd openssl-OpenSSL_1_1_0j/ && \
+    ./Configure -fPIC --prefix=/usr/local/ssl/ no-shared linux-x86_64 && \
     make && make install && \
-    rm -rf /OpenSSL_1_1_0h.tar.gz /openssl-OpenSSL_1_1_0h
+    rm -rf /OpenSSL_1_1_0j.tar.gz /openssl-OpenSSL_1_1_0j
 
 # LibCurl
-RUN curl -O -L  
https://github.com/curl/curl/releases/download/curl-7_54_0/curl-7.54.0.tar.gz 
&& \
-    tar xvfz curl-7.54.0.tar.gz && \
-    cd curl-7.54.0 && \
-    CFLAGS=-fPIC ./configure && \
+RUN curl -O -L  
https://github.com/curl/curl/releases/download/curl-7_58_0/curl-7.58.0.tar.gz 
&& \
+    tar xvfz curl-7.58.0.tar.gz && \
+    cd curl-7.58.0 && \
+    CFLAGS=-fPIC ./configure --with-ssl=/usr/local/ssl/ && \
     make && make install && \
-    rm -rf /curl-7.54.0.tar.gz /curl-7.54.0
-
+    rm -rf /curl-7.58.0.tar.gz /curl-7.58.0
 
 RUN apt-get install -y dpkg-dev
+
+ENV OPENSSL_ROOT_DIR /usr/local/ssl/
diff --git a/pulsar-client-cpp/pkg/rpm/Dockerfile 
b/pulsar-client-cpp/pkg/rpm/Dockerfile
index 2ff1288..05cf898 100644
--- a/pulsar-client-cpp/pkg/rpm/Dockerfile
+++ b/pulsar-client-cpp/pkg/rpm/Dockerfile
@@ -21,7 +21,7 @@
 
 FROM centos:7
 
-RUN yum update && \
+RUN yum update -y && \
     yum install -y gcc-c++ make cmake git rpm-build \
                 python-devel createrepo
 
@@ -64,20 +64,19 @@ RUN curl -O -L 
https://github.com/madler/zlib/archive/v1.2.11.tar.gz && \
     make && make install && \
     rm -rf /zlib-1.2.11.tar.gz /zlib-1.2.11
 
-RUN curl -O -L 
https://github.com/openssl/openssl/archive/OpenSSL_1_1_0h.tar.gz && \
-    tar xvfz OpenSSL_1_1_0h.tar.gz && \
-    cd openssl-OpenSSL_1_1_0h/ && \
-    ./Configure -fPIC no-shared linux-x86_64 && \
+RUN curl -O -L 
https://github.com/openssl/openssl/archive/OpenSSL_1_1_0j.tar.gz && \
+    tar xvfz OpenSSL_1_1_0j.tar.gz && \
+    cd openssl-OpenSSL_1_1_0j/ && \
+    ./Configure -fPIC --prefix=/usr/local/ssl/ no-shared linux-x86_64 && \
     make && make install && \
-    rm -rf /OpenSSL_1_1_0h.tar.gz /openssl-OpenSSL_1_1_0h
+    rm -rf /OpenSSL_1_1_0j.tar.gz /openssl-OpenSSL_1_1_0j
 
 # LibCurl
-RUN curl -O -L  
https://github.com/curl/curl/releases/download/curl-7_54_0/curl-7.54.0.tar.gz 
&& \
-    tar xvfz curl-7.54.0.tar.gz && \
-    cd curl-7.54.0 && \
-    CFLAGS=-fPIC ./configure && \
+RUN curl -O -L  
https://github.com/curl/curl/releases/download/curl-7_58_0/curl-7.58.0.tar.gz 
&& \
+    tar xvfz curl-7.58.0.tar.gz && \
+    cd curl-7.58.0 && \
+    CFLAGS=-fPIC ./configure --with-ssl=/usr/local/ssl/ && \
     make && make install && \
-    rm -rf /curl-7.54.0.tar.gz /curl-7.54.0
-
-
+    rm -rf /curl-7.58.0.tar.gz /curl-7.58.0
 
+ENV OPENSSL_ROOT_DIR /usr/local/ssl/

Reply via email to