<h3>Description</h3>
<p>I try load kamailio:5.1 and get this error</p>
<pre><code>/ # kamailio -DD -E
 0(167) ERROR: <core> [core/sr_module.c:582]: load_module(): could not open module </usr/lib/kamailio/modules/tls.so>: Error relocating /usr/lib/kamailio/modules/tls.so: X509_free: symbol not found
 0(167) CRITICAL: <core> [core/cfg.y:3460]: yyerror_at(): parse error in config file /etc/kamailio/tls-role.cfg, line 7, column 12-19: failed to load module
 0(167) ERROR: <core> [core/modparam.c:152]: set_mod_param_regex(): No module matching <tls> found
 0(167) CRITICAL: <core> [core/cfg.y:3463]: yyerror_at(): parse error in config file /etc/kamailio/tls-role.cfg, line 8, column 56: Can't set module parameter
 0(167) ERROR: <core> [core/modparam.c:152]: set_mod_param_regex(): No module matching <tls> found
 0(167) CRITICAL: <core> [core/cfg.y:3463]: yyerror_at(): parse error in config file /etc/kamailio/tls-role.cfg, line 9, column 40: Can't set module parameter
ERROR: bad config file (3 errors)
 0(167) INFO: <core> [core/sctp_core.c:53]: sctp_core_destroy(): SCTP API not initialized
/ # 
</code></pre>
<p>Used <code>alpine:edge</code> with <code>OpenSSL</code></p>
<h3>Troubleshooting</h3>
<p><code>ldd</code> utility properly located all shared libs</p>
<pre><code>/ # LD_PRELOAD=/usr/sbin/kamailio ldd /usr/lib/kamailio/modules/tls.so
        ldd (0x7fba9200c000)
        /usr/sbin/kamailio => /usr/sbin/kamailio (0x7fba91c09000)
        libssl.so.1.1 => /lib/libssl.so.1.1 (0x7fba91b8a000)
        libc.musl-x86_64.so.1 => ldd (0x7fba9200c000)
        libcrypto.so.1.1 => /lib/libcrypto.so.1.1 (0x7fba9190d000)
/ # 
</code></pre>
<p>Symbol located at <code>/lib/libcrypto.so.1.1</code> of <a href="https://pkgs.alpinelinux.org/package/edge/main/x86_64/libcrypto1.1" rel="nofollow"><code>OpenSSL</code></a> package</p>
<pre><code>/ # apk info --who-owns /lib/libcrypto.so.1.1
/lib/libcrypto.so.1.1 is owned by libcrypto1.1-1.1.1a-r0
</code></pre>
<h4>Reproduction</h4>
<p>Need to add tls module to kamailio config and start kamailio.</p>
<h4>Debugging Data</h4>
<p>N/A</p>
<h4>Log Messages</h4>
<p>Provided above</p>
<h4>SIP Traffic</h4>
<p>N/A</p>
<h3>Possible Solutions</h3>
<p>Not known</p>
<h3>Additional Information</h3>
<ul>
<li><strong>Kamailio Version</strong> - output of <code>kamailio -v</code></li>
</ul>
<pre><code>/ # kamailio -v
version: kamailio 5.1.6 (x86_64/linux) 
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144 MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown 
compiled on 03:24:34 Nov 23 2018 with gcc 8.2.0
</code></pre>
<ul>
<li><strong>Operating System</strong>:</li>
</ul>
<pre><code>/ # uname -a
Linux node1a.i-telecoms.com 3.10.0-862.14.4.el7.x86_64 #1 SMP Wed Sep 26 15:12:11 UTC 2018 x86_64 Linux
/ # cat /etc/os-release 
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.8.0
PRETTY_NAME="Alpine Linux v3.8"
HOME_URL="http://alpinelinux.org"
BUG_REPORT_URL="http://bugs.alpinelinux.org"
/ # 
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/1738">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZSHTZ5E7ZL1gomTwrSOKN1GbEfo4ks5uyC8zgaJpZM4Yw93j">mute the thread</a>.<img src="https://github.com/notifications/beacon/AF36ZQZDTj8L06S6_waGtahPzuTADrGGks5uyC8zgaJpZM4Yw93j.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"[5.1] cannot start TLS module on Alpine (#1738)"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1738"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/1738",
"url": "https://github.com/kamailio/kamailio/issues/1738",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
},
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"hideOriginalBody": "false",
"originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB",
"title": "[5.1] cannot start TLS module on Alpine (#1738)",
"sections": [
{
"text": "",
"activityTitle": "**sergey-safarov**",
"activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png",
"activitySubtitle": "@sergey-safarov",
"facts": [
{
"name": "Repository: ",
"value": "kamailio/kamailio"
},
{
"name": "Issue #: ",
"value": 1738
}
]
}
],
"potentialAction": [
{
"name": "Add a comment",
"@type": "ActionCard",
"inputs": [
{
"isMultiLine": true,
"@type": "TextInput",
"id": "IssueComment",
"isRequired": false
}
],
"actions": [
{
"name": "Comment",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"kamailio/kamailio\",\n\"issueId\": 1738,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}"
}
]
},
{
"name": "Close issue",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueClose\",\n\"repositoryFullName\": \"kamailio/kamailio\",\n\"issueId\": 1738\n}"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/kamailio/kamailio/issues/1738"
}
],
"@type": "OpenUri",
"name": "View on GitHub"
},
{
"name": "Unsubscribe",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 415489507\n}"
}
],
"themeColor": "26292E"
}
]</script>