gstreamer/subprojects/gst-plugins-good/tests/examples
Arnaud Rebillout 56e636b60c examples: gtk: Add example to illustrate usage of accept-certificate with souphttpsrc
The aim of this example is to show how to make use of the accept-certificate
signal from a GTK GUI, and prompt user in case of invalid certificate.

There are two subtleties to be aware of:

1. the signal is emitted from the GStreamer streaming thread, therefore the
   caller can't modify the GUI straight away, instead they must do it from the
   main thread (eg. by using g_idle_add())

2. in case of a redirection, then a TLS failure, the caller won't know
   about the redirection. Actually, it's possible to be notified of the
   redirection by watching "message:element" and inspecting http-headers,
   but even in that case, the signal will be received *after* the signal
   "accept-certificate" (even though the redirection happened *before*).

This second point is tricky. It's not uncommon to have servers that redirect
http requests to https. So errors of the type "HTTP -> HTTPS -> TLS error"
happen, and if the caller doesn't care about redirection, they might prompt
users with a message such as "TLS error for URL http://...", which wouldn't make
much sense.

This example shows how to handle that right, by connecting to the signal
"message:element", inspecting the http-headers, and in case of redirection,
updating the TLS error dialog to indicate that the request was redirected.

Here are a few examples of streams that exhibit TLS failure (at the time of
this commit, of course):
* https://radiolive.sanjavier.es:8443/stream: unknown-ca
* https://am981.ddns.net:9005/stream.ogg: unknown-ca
* http://stream.diazol.hu:7092/zene.mp3: redir then bad-identity
* https://streaming.fabrik.fm/izwi/echocast/audio/index.m3u8: unknown-ca
  (this one is a HLS stream)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4925>
2023-06-29 16:27:31 +00:00
..
audiofx Move files from gst-plugins-good into the "subprojects/gst-plugins-good/" subdir 2021-09-24 16:13:50 -03:00
cairo Move files from gst-plugins-good into the "subprojects/gst-plugins-good/" subdir 2021-09-24 16:13:50 -03:00
equalizer Move files from gst-plugins-good into the "subprojects/gst-plugins-good/" subdir 2021-09-24 16:13:50 -03:00
gtk examples: gtk: Add example to illustrate usage of accept-certificate with souphttpsrc 2023-06-29 16:27:31 +00:00
jack jack: Dynamically load libjack at runtime instead of linking 2023-04-20 11:10:15 +03:00
level Move files from gst-plugins-good into the "subprojects/gst-plugins-good/" subdir 2021-09-24 16:13:50 -03:00
qt qt: Retain compatibility with Qt 5.9 2022-01-25 09:51:16 +00:00
qt6 qml6: add a mixer element 2023-05-19 01:48:57 +00:00
rpicamsrc good: tests: drop use of GSlice 2023-01-24 15:25:07 +00:00
rtp rtp: examples: client-rtpaux: Provide correct caps by payload type and RTX pt map by session 2022-10-10 14:56:18 +00:00
rtsp rtspsrc: Introduce new action signal push-backchannel-sample with correct ownership semantics 2022-11-10 13:04:04 +02:00
shapewipe Move files from gst-plugins-good into the "subprojects/gst-plugins-good/" subdir 2021-09-24 16:13:50 -03:00
spectrum Move files from gst-plugins-good into the "subprojects/gst-plugins-good/" subdir 2021-09-24 16:13:50 -03:00
v4l2 examples: v4l2: Add v4l2src crop example 2022-03-11 15:02:08 +00:00
meson.build add new plugin for Qt 6 rendering inside a QML scene 2022-11-24 16:11:04 +11:00