# TLS SIP Trunk Configuration Problem

**URL:** <https://community.freepbx.org/t/tls-sip-trunk-configuration-problem/41341>\
**Category:** General Help\
**Created:** [May 19, 2017, 6:25am UTC](https://community.freepbx.org/t/tls-sip-trunk-configuration-problem/41341 "2017-05-19T06:25:39Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![amin1356](https://community.freepbx.org/user_avatar/community.freepbx.org/amin1356/32/10910_2.png) [@amin1356](https://community.freepbx.org/u/amin1356)\
**Post date:** [May 19, 2017, 6:25am UTC](https://community.freepbx.org/t/tls-sip-trunk-configuration-problem/41341/1 "2017-05-19T06:25:39Z")

</div>

Hi,  
I have two FreePBX servers that both of them are in the same LAN.  
Server A is FreePBX 10.13.66 with TLS enabled also created extension 201 in this server with TLS enabled.  
Server B is FreePBX 10.13.66 with TLS enabled.  
I want to set up a SIP Trunk in server B to register to server A extension 201 via TLS.

My Trunk “PEER Details” of server B is as follow:

host=192.168.1.50 (IP address of server A)  
fromdomain=192.168.1.50  
port=3935 (custom TLS port of server A)  
transport=tls  
username=201 (extension number in server A)  
fromuser=201  
secret=123456 (extension password in server A)  
nat=yes  
type=peer  
qualify=yes  
canreinvite=no  
insecure=port,invite  
context=from-trunk  
disallow=all  
allow=ulaw&alaw

My Trunk Registration String as follow:

tls://201:123456@192.168.1.50:3935/201

My problem is this trunk on server B can not register to server A. But if I use UDP Trunk it will be ok.  
I tested to register to extension 201 with enabled TLS softphone (Like Zoiper) and it was ok.

Is there anybody who has TLS SIP Trunking experience?  
Thanks for your help,

---

<div class="post-metadata">

**Author:** ![amin1356](https://community.freepbx.org/user_avatar/community.freepbx.org/amin1356/32/10910_2.png) [@amin1356](https://community.freepbx.org/u/amin1356)\
**Post date:** [May 21, 2017, 7:43pm UTC](https://community.freepbx.org/t/tls-sip-trunk-configuration-problem/41341/2 "2017-05-21T19:43:42Z")

</div>

Isn’t here anybody with TLS Trunking experience?!

---

<div class="post-metadata">

**Author:** ![billsimon](https://community.freepbx.org/user_avatar/community.freepbx.org/billsimon/32/8369_2.png) [@billsimon](https://community.freepbx.org/u/billsimon)\
**Post date:** [May 22, 2017, 6:34pm UTC](https://community.freepbx.org/t/tls-sip-trunk-configuration-problem/41341/3 "2017-05-22T18:34:24Z")

</div>

If you are using TLS then you must use host names, not IP addresses, since your TLS certificates are issued for specific names or domain wildcards.

---

<div class="post-metadata">

**Author:** ![amin1356](https://community.freepbx.org/user_avatar/community.freepbx.org/amin1356/32/10910_2.png) [@amin1356](https://community.freepbx.org/u/amin1356)\
**Post date:** [May 22, 2017, 6:51pm UTC](https://community.freepbx.org/t/tls-sip-trunk-configuration-problem/41341/4 "2017-05-22T18:51:26Z")

</div>

Thanks for your reply,  
But I use FreePBX self signed certificate.

---

<div class="post-metadata">

**Author:** ![dicko](https://community.freepbx.org/user_avatar/community.freepbx.org/dicko/32/8712_2.png) [@dicko](https://community.freepbx.org/u/dicko)\
**Post date:** [May 22, 2017, 6:55pm UTC](https://community.freepbx.org/t/tls-sip-trunk-configuration-problem/41341/5 "2017-05-22T18:55:04Z")

</div>

Never mind

---

<div class="post-metadata">

**Author:** ![billsimon](https://community.freepbx.org/user_avatar/community.freepbx.org/billsimon/32/8369_2.png) [@billsimon](https://community.freepbx.org/u/billsimon)\
**Post date:** [May 22, 2017, 6:57pm UTC](https://community.freepbx.org/t/tls-sip-trunk-configuration-problem/41341/6 "2017-05-22T18:57:08Z")

</div>

Then you would need to set “Don’t Verify Server” to YES in the Asterisk SIP settings on your server B. It can’t verify a self-signed certificate presented by server A.

---

<div class="post-metadata">

**Author:** ![billsimon](https://community.freepbx.org/user_avatar/community.freepbx.org/billsimon/32/8369_2.png) [@billsimon](https://community.freepbx.org/u/billsimon)\
**Post date:** [May 22, 2017, 7:03pm UTC](https://community.freepbx.org/t/tls-sip-trunk-configuration-problem/41341/7 "2017-05-22T19:03:56Z")

</div>

Also, just a little more commentary - this doesn’t make much sense. Why would you want to register an Asterisk server to an extension configured on another Asterisk server, over TLS, on the same LAN?

But since you asked about registration, you should know that you have to configure the registration string for TLS also, not just the peer details. The registration string must start with tls:// otherwise it will use UDP to register.

---

<div class="post-metadata">

**Author:** ![amin1356](https://community.freepbx.org/user_avatar/community.freepbx.org/amin1356/32/10910_2.png) [@amin1356](https://community.freepbx.org/u/amin1356)\
**Post date:** [May 22, 2017, 7:28pm UTC](https://community.freepbx.org/t/tls-sip-trunk-configuration-problem/41341/8 "2017-05-22T19:28:47Z")

</div>

> [@billsimon](#):
>
> Then you would need to set “Don’t Verify Server” to YES in the Asterisk SIP settings on your server B. It can’t verify a self-signed certificate presented by server A.

I set “Don’t Verify Server” to YES in the Asterisk SIP settings on my server B but again the trunk on server B can not register to extension 201 on server A.

---

<div class="post-metadata">

**Author:** ![billsimon](https://community.freepbx.org/user_avatar/community.freepbx.org/billsimon/32/8369_2.png) [@billsimon](https://community.freepbx.org/u/billsimon)\
**Post date:** [May 22, 2017, 7:36pm UTC](https://community.freepbx.org/t/tls-sip-trunk-configuration-problem/41341/9 "2017-05-22T19:36:24Z")

</div>

That’s all the guessing I can do. You will have to look at the logs on the server, perhaps set the debugging level higher or turn on SIP debugs to get a full understanding of what exactly is wrong. Once you have something specific, post here again for help.

---

<div class="post-metadata">

**Author:** ![amin1356](https://community.freepbx.org/user_avatar/community.freepbx.org/amin1356/32/10910_2.png) [@amin1356](https://community.freepbx.org/u/amin1356)\
**Post date:** [May 22, 2017, 7:42pm UTC](https://community.freepbx.org/t/tls-sip-trunk-configuration-problem/41341/10 "2017-05-22T19:42:36Z")

</div>

> [@billsimon](#):
>
> Also, just a little more commentary - this doesn’t make much sense. Why would you want to register an Asterisk server to an extension configured on another Asterisk server, over TLS, on the same LAN?

I just wanted to test this scenario on LAN then use it on the remote place via internet.

> [@billsimon](#):
>
> But since you asked about registration, you should know that you have to configure the registration string for TLS also, not just the peer details. The registration string must start with tls:// otherwise it will use UDP to register.

I configured the registration string as follow:  
tls://201:123456@192.168.1.50:3935/201  
But again registration failed.

---

<div class="post-metadata">

**Author:** ![amin1356](https://community.freepbx.org/user_avatar/community.freepbx.org/amin1356/32/10910_2.png) [@amin1356](https://community.freepbx.org/u/amin1356)\
**Post date:** [May 22, 2017, 7:47pm UTC](https://community.freepbx.org/t/tls-sip-trunk-configuration-problem/41341/11 "2017-05-22T19:47:04Z")

</div>

> [@billsimon](#):
>
> That’s all the guessing I can do. You will have to look at the logs on the server, perhaps set the debugging level higher or turn on SIP debugs to get a full understanding of what exactly is wrong. Once you have something specific, post here again for help.

Thanks for your help,  
The Log on server B is as follow:

## [2017-05-23 00:22:36] NOTICE[1953] chan\_sip.c: – Registration for ‘201@192.168.1.50’ timed out, trying again (Attempt #91) [2017-05-23 00:22:36] WARNING[5799] tcptls.c: Usage of SSLv2 is discouraged due to known vulnerabilities. Please use ‘tlsv1’ or leave the TLS method unspecified! [2017-05-23 00:22:36] VERBOSE[5799] tcptls.c: SSL certificate ok [2017-05-23 00:22:36] VERBOSE[5799] tcptls.c: == Problem setting up ssl connection: error:00000000:lib(0):func(0):reason(0) [2017-05-23 00:22:36] WARNING[5799] tcptls.c: FILE \* open failed!

The Log on server A is as follow:

[2017-05-23 00:39:21] VERBOSE[30478] tcptls.c: == Problem setting up ssl connection: error:140760FC:SSL routines:SSL23\_GET\_CLIENT\_HELLO:unknown protocol  
[2017-05-23 00:39:21] WARNING[30478] tcptls.c: FILE \* open failed!

---

<div class="post-metadata">

**Author:** ![dicko](https://community.freepbx.org/user_avatar/community.freepbx.org/dicko/32/8712_2.png) [@dicko](https://community.freepbx.org/u/dicko)\
**Post date:** [May 22, 2017, 7:53pm UTC](https://community.freepbx.org/t/tls-sip-trunk-configuration-problem/41341/12 "2017-05-22T19:53:03Z")

</div>

All your questions in that last post are answered in the wiki with a link above, it is absolutely essential you absorb it all before you try and do “clever sh\*t” 😉

---

<div class="post-metadata">

**Author:** ![billsimon](https://community.freepbx.org/user_avatar/community.freepbx.org/billsimon/32/8369_2.png) [@billsimon](https://community.freepbx.org/u/billsimon)\
**Post date:** [May 23, 2017, 2:38pm UTC](https://community.freepbx.org/t/tls-sip-trunk-configuration-problem/41341/13 "2017-05-23T14:38:16Z")

</div>

Yes, just do as it says, get the TLS protocol versions to match and you should be good to go.

---

<div class="post-metadata">

**Author:** ![amin1356](https://community.freepbx.org/user_avatar/community.freepbx.org/amin1356/32/10910_2.png) [@amin1356](https://community.freepbx.org/u/amin1356)\
**Post date:** [May 23, 2017, 3:37pm UTC](https://community.freepbx.org/t/tls-sip-trunk-configuration-problem/41341/14 "2017-05-23T15:37:14Z")

</div>

My problem solved by your helps. 🙂  
Thanks so much for helping me to solve this issue. 🌹  
Also thank you very much for noticing me that registration string must start with tls:// otherwise it will use UDP to register. 💐
