From ad195a6bd0313400939c553b357d6445bc38264f Mon Sep 17 00:00:00 2001 From: aler9 <46489434+aler9@users.noreply.github.com> Date: Sun, 20 Dec 2020 12:51:04 +0100 Subject: [PATCH] use 'strict' instead of 'yes' in the 'encryption' parameter --- internal/conf/conf.go | 6 +++--- main.go | 2 +- rtsp-simple-server.yml | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/conf/conf.go b/internal/conf/conf.go index 41ddac2a..05aa2843 100644 --- a/internal/conf/conf.go +++ b/internal/conf/conf.go @@ -20,7 +20,7 @@ type Encryption int const ( EncryptionNo Encryption = iota EncryptionOptional - EncryptionYes + EncryptionStrict ) // Conf is the main program configuration. @@ -123,8 +123,8 @@ func (conf *Conf) fillAndCheck() error { case "optional": conf.EncryptionParsed = EncryptionOptional - case "yes", "true": - conf.EncryptionParsed = EncryptionYes + case "strict", "yes", "true": + conf.EncryptionParsed = EncryptionStrict if _, ok := conf.ProtocolsParsed[gortsplib.StreamProtocolUDP]; ok { return fmt.Errorf("encryption can't be used with the UDP stream protocol") diff --git a/main.go b/main.go index a012ab68..6aafecc3 100644 --- a/main.go +++ b/main.go @@ -207,7 +207,7 @@ func (p *program) createResources(initial bool) error { } if p.serverTLS == nil { - if p.conf.EncryptionParsed == conf.EncryptionYes || p.conf.EncryptionParsed == conf.EncryptionOptional { + if p.conf.EncryptionParsed == conf.EncryptionStrict || p.conf.EncryptionParsed == conf.EncryptionOptional { p.serverTLS, err = servertls.New(p.conf.RtspsPort, p.conf.ReadTimeout, p.conf.WriteTimeout, p.conf.ServerKey, p.conf.ServerCert, p) if err != nil { diff --git a/rtsp-simple-server.yml b/rtsp-simple-server.yml index bb472434..9694d046 100644 --- a/rtsp-simple-server.yml +++ b/rtsp-simple-server.yml @@ -13,19 +13,19 @@ logFile: rtsp-simple-server.log # The handshake is always performed with TCP. protocols: [udp, tcp] # encrypt handshake and TCP streams with TLS (RTSPS). -# available values are "no", "yes", "optional". +# available values are "no", "strict", "optional". encryption: no # port of the TCP/RTSP listener. This is used only if encryption is "no" or "optional". rtspPort: 8554 -# port of the TCP/TLS/RTSPS listener. This is used only if encryption is "yes" or "optional". +# port of the TCP/TLS/RTSPS listener. This is used only if encryption is "strict" or "optional". rtspsPort: 8555 # port of the UDP/RTP listener. This is used only if "udp" is in protocols. rtpPort: 8000 # port of the UDP/RTCP listener. This is used only if "udp" is in protocols. rtcpPort: 8001 -# path to the server key. This is used only if encryption is "yes" or "optional". +# path to the server key. This is used only if encryption is "strict" or "optional". serverKey: server.key -# path to the server certificate. This is used only if encryption is "yes" or "optional". +# path to the server certificate. This is used only if encryption is "strict" or "optional". serverCert: server.crt # authentication methods. authMethods: [basic, digest]