WebRTC makes use of TURN-Servers if the direct peer to peer connection fails. There are two protocols available: TURN and TURNS (TURN over TLS).

According to the MDN:

All data transferred using WebRTC is encrypted.

If all data sent via a data channel is end to end encrypted with DTLS by default, why does TURNS even exists?

Isn't TURNS only encrypting the connection between the server and the client?

Wouldn't that be unnecessary overhead?

EDIT - Why not simply use plain TURNwithout any server/client encryption? I know what TURN-servers are used for, but I do not get why we would want to encrypt the connection to the TURN-server. Because of the DTLS encryption between the peers, the TURN-server cannot read any of the transferred data. Hence nobody else can, so why even bother adding another layer of encryption?


One reason is for better firewall traversal. You can get past some stricter firewalls with TURN/TLS over port 443 to disguise WebRTC traffic as HTTPS traffic.


There are three transport modes - TURN/UDP, TURN/TCP & TURN/TLS. Depending on LAN FW policy, browser will select the least restrictive transport mode.


From my understanding Traversal Using Relays around NAT (TURN) seems more aimed towards better traversal of firewalls behind NAT, RFC5766. So, although the TURN server handles encryption (like a web server handles HTTPS), it's not the primary use of TURN servers.

TURN Server

If direct communication is allowed, but the firewall blocked signalling, no initiation would take place: no P2P communication would be established.


Image source, and further explanation

TURN's purpose of firewall traversal could equally be achieved by using an SSL VPN or OpenVPN to circumvent restrict firewall(s).

  • 2
    This answer doesn't seem to include anything about the difference between TURN and TURNS. – Macil Apr 30 '18 at 23:58
  • 1
    Thanks for your answer! :) But my question aims at why we need to encrypt the TURN connection with TLS. As far as I understand TLS is obsolete in this case. – Someone else May 1 '18 at 8:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.