turn server tls (#38)

* tls

* acm

* use cert/key files

* turn -> turns

* turn cert config

* updates

* move panic

* tidy

* final updates
This commit is contained in:
David Colburn
2021-07-01 17:00:49 -05:00
committed by GitHub
parent 4e6eafa63c
commit e543aaa98a
7 changed files with 74 additions and 57 deletions
+6 -5
View File
@@ -9,14 +9,15 @@ import (
"github.com/pion/turn/v2"
"github.com/stretchr/testify/require"
"github.com/livekit/protocol/utils"
"github.com/livekit/livekit-server/pkg/config"
"github.com/livekit/livekit-server/pkg/routing"
"github.com/livekit/livekit-server/pkg/service"
livekit "github.com/livekit/livekit-server/proto"
"github.com/livekit/protocol/utils"
)
func TestTurnServer(t *testing.T) {
func testTurnServer(t *testing.T) {
conf, err := config.NewConfig("")
require.NoError(t, err)
@@ -47,15 +48,15 @@ func TestTurnServer(t *testing.T) {
require.NoError(t, roomStore.CreateRoom(rm))
turnConf := &turn.ClientConfig{
STUNServerAddr: fmt.Sprintf("localhost:%d", conf.TURN.UDPPort),
TURNServerAddr: fmt.Sprintf("%s:%d", currentNode.Ip, conf.TURN.UDPPort),
STUNServerAddr: fmt.Sprintf("localhost:%d", conf.TURN.TLSPort),
TURNServerAddr: fmt.Sprintf("%s:%d", currentNode.Ip, conf.TURN.TLSPort),
Username: rm.Name,
Password: rm.TurnPassword,
Realm: "livekit",
}
t.Run("TURN works over TCP", func(t *testing.T) {
conn, err := net.Dial("tcp", fmt.Sprintf("localhost:%d", conf.TURN.TCPPort))
conn, err := net.Dial("tcp", fmt.Sprintf("localhost:%d", conf.TURN.TLSPort))
require.NoError(t, err)
tc := *turnConf