From 68b862c7f6b93eb2ca820558eefe2d77c31fe6cf Mon Sep 17 00:00:00 2001 From: Alessandro Ros Date: Thu, 2 Nov 2023 12:38:20 +0100 Subject: [PATCH] webrtc: allow using sourceFingerprint with WebRTC sources (#2618) (#2626) --- internal/staticsources/webrtc/source.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/internal/staticsources/webrtc/source.go b/internal/staticsources/webrtc/source.go index d598fdd6..c5c4ee7c 100644 --- a/internal/staticsources/webrtc/source.go +++ b/internal/staticsources/webrtc/source.go @@ -13,6 +13,7 @@ import ( "github.com/bluenviron/mediamtx/internal/conf" "github.com/bluenviron/mediamtx/internal/defs" "github.com/bluenviron/mediamtx/internal/logger" + "github.com/bluenviron/mediamtx/internal/protocols/tls" "github.com/bluenviron/mediamtx/internal/protocols/webrtc" ) @@ -39,14 +40,15 @@ func (s *Source) Run(params defs.StaticSourceRunParams) error { u.Scheme = strings.ReplaceAll(u.Scheme, "whep", "http") - hc := &http.Client{ - Timeout: time.Duration(s.ReadTimeout), - } - client := webrtc.WHIPClient{ - HTTPClient: hc, - URL: u, - Log: s, + HTTPClient: &http.Client{ + Timeout: time.Duration(s.ReadTimeout), + Transport: &http.Transport{ + TLSClientConfig: tls.ConfigForFingerprint(params.Conf.SourceFingerprint), + }, + }, + URL: u, + Log: s, } tracks, err := client.Read(params.Context)