• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1############################################################################
2#
3# OpenSSL dual versions
4#
5# Works with CentOS 7
6#
7############################################################################
8#
9# Add in alternative OpenSSL support into /opt/openssl.  /opt/openssl is
10# chosen instead of the default of /usr/local so that existing utilities
11# continue to use the original version of OpenSSL and so only specific
12# applications that requires the newer version of OpenSSL will pick up the
13# new code.
14#
15# Download latest stable version of openssl.X.Y.Z.tar.gz from
16# https://www.openssl.org/source/
17
18tar zxovf openssl.X.Y.Z.tar.gz
19cd openssl.X.Y.X
20./config --prefix=/opt/openssl --openssldir=/opt/openssl
21make
22sudo make install_sw
23
24# The following should not clash the existing OpenSSL lib*.so.1.0 usage unless
25# the previous OpenSSL version is 1.1.0 or later.
26# It just makes things for running executables a lot simpler.
27sudo cp /opt/openssl/lib/lib*.so.1.1 /lib64
28cd ..
29
30############################################################################
31#
32# libcoap build with updated OpenSSL
33#
34############################################################################
35
36# Get the latest libcoap
37git clone https://github.com/obgm/libcoap.git
38
39# Build code
40cd libcoap
41./autogen.sh
42# Update --enable- / --disable- options as appropriate
43# libcoap libraries are put into /usr/lib64 for ease of linking
44PKG_CONFIG_PATH=/opt/openssl/lib/pkgconfig ./configure --libdir=/usr/lib64 \
45  --with-openssl --enable-tests --enable-examples --disable-doxygen \
46  --disable-manpages
47make
48sudo make install
49cd ..
50
51