webrtcsink: Fix uri and cafile property setting for signaller

When run-signalling-server is true, if a certificate is provided,
signaller uri should use wss and the cafile property should also
be set to use this certificate.

Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/633
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2487>
This commit is contained in:
Sanchayan Maity 2025-08-22 12:23:26 +05:30
parent 69d4a2bbdc
commit c3890ffa4e

View file

@ -5674,10 +5674,17 @@ impl WebRTCSink {
host => host.to_string(),
};
signaller.set_property(
"uri",
format!("ws://{}:{}", host, settings.signalling_server_port),
);
let scheme = if settings.signalling_server_cert.is_some()
{
let cafile = settings.signalling_server_cert.as_ref().unwrap();
signaller.set_property("cafile", cafile);
"wss"
} else {
"ws"
};
let uri = format!("{}://{}:{}", scheme, host, settings.signalling_server_port);
signaller.set_property("uri", uri);
}
if let Err(err) = LazyLock::force(&SIGNALLING_LOGGING) {