From 29a8d78e5cb958ef66a3c9075ea4b8bb88b0da40 Mon Sep 17 00:00:00 2001 From: cnderrauber Date: Fri, 20 Aug 2021 19:10:51 +0800 Subject: [PATCH] add unencrypt cipher --- dtlstransport.go | 4 +++- go.mod | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/dtlstransport.go b/dtlstransport.go index 1837df9357c..05ad2b91ffd 100644 --- a/dtlstransport.go +++ b/dtlstransport.go @@ -309,7 +309,7 @@ func (t *DTLSTransport) Start(remoteParameters DTLSParameters) error { PrivateKey: cert.privateKey, }, }, - SRTPProtectionProfiles: []dtls.SRTPProtectionProfile{dtls.SRTP_AEAD_AES_128_GCM, dtls.SRTP_AES128_CM_HMAC_SHA1_80}, + SRTPProtectionProfiles: []dtls.SRTPProtectionProfile{dtls.SRTP_UNENCRYPTED, dtls.SRTP_AEAD_AES_128_GCM, dtls.SRTP_AES128_CM_HMAC_SHA1_80}, ClientAuth: dtls.RequireAnyClientCert, LoggerFactory: t.api.settingEngine.LoggerFactory, InsecureSkipVerify: true, @@ -356,6 +356,8 @@ func (t *DTLSTransport) Start(remoteParameters DTLSParameters) error { t.srtpProtectionProfile = srtp.ProtectionProfileAeadAes128Gcm case dtls.SRTP_AES128_CM_HMAC_SHA1_80: t.srtpProtectionProfile = srtp.ProtectionProfileAes128CmHmacSha1_80 + case dtls.SRTP_UNENCRYPTED: + t.srtpProtectionProfile = srtp.ProtectionProfileUnencrypted default: t.onStateChange(DTLSTransportStateFailed) return ErrNoSRTPProtectionProfile diff --git a/go.mod b/go.mod index e532c36d64f..b6c19bf1e61 100644 --- a/go.mod +++ b/go.mod @@ -21,3 +21,7 @@ require ( github.com/stretchr/testify v1.7.0 golang.org/x/net v0.0.0-20210420210106-798c2154c571 ) + +replace github.com/pion/srtp/v2 v2.0.2 => github.com/cnderrauber/srtp v2.0.6 + +replace github.com/pion/dtls/v2 v2.0.9 => github.com/cnderrauber/dtls v2.0.10