<p>These are roughly the steps that I've followed to switch to OpenSSL 1.0.2r and rebuild Kamailio TLS module. Hope this helps!</p>
<p>First of all you need to make and install OpenSSL 1.0.2r from source.</p>
<pre><code>sudo apt install build-essential checkinstall zlib1g-dev -y

cd /usr/src

wget https://www.openssl.org/source/openssl-1.0.2r.tar.gz

tar -xvzf openssl-1.0.2r.tar.gz

cd openssl-1.0.2r

./config -d --prefix=/usr/local/ssl --openssldir=/usr/local/ssl shared zlib

make
make test

make install

nano /etc/ld.so.conf.d/openssl-1.0.2r.conf
</code></pre>
<p>Add this line and save:<br>
/usr/local/ssl/lib</p>
<pre><code>sudo ldconfig -v

mv /usr/bin/c_rehash /usr/bin/c_rehash.BEKUP
mv /usr/bin/openssl /usr/bin/openssl.BEKUP

export PATH=$PATH:/usr/local/ssl/bin
</code></pre>
<p>Link binaries to path:<br>
sudo ln -s /usr/local/ssl/bin/c_rehash /usr/bin/c_rehash<br>
sudo ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl</p>
<p>Restart.<br>
sudo shutdown -r now</p>
<p>Check OpenSSL path, should return '/usr/bin/openssl'.<br>
which openssl</p>
<p>Check OpenSSL version, should return 'OpenSSL 1.0.2r  26 Feb 2019'<br>
openssl version</p>
<p>Modify '/usr/src/kamailio/src/modules/tls/makefile'.</p>
<p>Changed this:<br>
ifneq ($(SSL_BUILDER),)<br>
DEFS += $(shell $(SSL_BUILDER) --cflags)<br>
LIBS += $(shell $(SSL_BUILDER) --libs)<br>
else<br>
DEFS += -I$(LOCALBASE)/ssl/include<br>
LIBS += -L$(LOCALBASE)/lib -L$(LOCALBASE)/ssl/lib <br>
-L$(LOCALBASE)/lib64 -L$(LOCALBASE)/ssl/lib64 <br>
-lssl -lcrypto<br>
# NOTE: depending on the way in which libssl was compiled you might<br>
#       have to add -lz -lkrb5   (zlib and kerberos5).<br>
#       E.g.: make TLS_HOOKS=1 TLS_EXTRA_LIBS="-lz -lkrb5"<br>
endif</p>
<p>To this:<br>
DEFS+=  -I/usr/local/ssl/include<br>
LIBS+=  -L/usr/local/ssl/lib <br>
-lssl -lcrypto</p>
<p>Make clean, make and make install:<br>
cd /usr/src/kamailio/src/modules/tls<br>
make clean<br>
make<br>
make install</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you commented.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/1860#issuecomment-491161003">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZMEVHRQYC6E5VOVPPLPUUBUFANCNFSM4GYVXBZA">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABO7UZJUE7PFGOY4HUHGN6DPUUBUFA5CNFSM4GYVXBZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVDILKY.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/1860#issuecomment-491161003",
"url": "https://github.com/kamailio/kamailio/issues/1860#issuecomment-491161003",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>