mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 04:36:20 +00:00
rtspconnection: allow setting tls certificate validation
Added new functions gst_rtsp_connection_set_tls_validation_flags() to allow setting the TLS certificate validation flags when establishing a TLS connection. A getter is also available, gst_rtsp_connection_get_tls_validation_flags(). https://bugzilla.gnome.org/show_bug.cgi?id=711231
This commit is contained in:
parent
a4996f133b
commit
53c7ad0c87
2 changed files with 49 additions and 0 deletions
|
@ -446,6 +446,53 @@ gst_rtsp_connection_get_tls (GstRTSPConnection * conn, GError ** error)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gst_rtsp_connection_set_tls_validation_flags:
|
||||||
|
* @conn: a #GstRTSPConnection
|
||||||
|
* @flags: the validation flags.
|
||||||
|
*
|
||||||
|
* Sets the TLS validation flags to be used to verify the peer
|
||||||
|
* certificate when a TLS connection is established.
|
||||||
|
*
|
||||||
|
* Returns: TRUE if the validation flags are set correctly, or FALSE if
|
||||||
|
* @conn is NULL or is not a TLS connection.
|
||||||
|
*
|
||||||
|
* Since: 1.2.1
|
||||||
|
*/
|
||||||
|
gboolean
|
||||||
|
gst_rtsp_connection_set_tls_validation_flags (GstRTSPConnection * conn,
|
||||||
|
GTlsCertificateFlags flags)
|
||||||
|
{
|
||||||
|
gboolean res = FALSE;
|
||||||
|
|
||||||
|
g_return_val_if_fail (conn != NULL, FALSE);
|
||||||
|
|
||||||
|
res = g_socket_client_get_tls (conn->client);
|
||||||
|
if (res)
|
||||||
|
g_socket_client_set_tls_validation_flags (conn->client, flags);
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gst_rtsp_connection_get_tls_validation_flags:
|
||||||
|
* @conn: a #GstRTSPConnection
|
||||||
|
*
|
||||||
|
* Gets the TLS validation flags used to verify the peer certificate
|
||||||
|
* when a TLS connection is established.
|
||||||
|
*
|
||||||
|
* Returns: the validationg flags.
|
||||||
|
*
|
||||||
|
* Since: 1.2.1
|
||||||
|
*/
|
||||||
|
GTlsCertificateFlags
|
||||||
|
gst_rtsp_connection_get_tls_validation_flags (GstRTSPConnection * conn)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (conn != NULL, 0);
|
||||||
|
|
||||||
|
return g_socket_client_get_tls_validation_flags (conn->client);
|
||||||
|
}
|
||||||
|
|
||||||
static GstRTSPResult
|
static GstRTSPResult
|
||||||
setup_tunneling (GstRTSPConnection * conn, GTimeVal * timeout, gchar * uri)
|
setup_tunneling (GstRTSPConnection * conn, GTimeVal * timeout, gchar * uri)
|
||||||
{
|
{
|
||||||
|
|
|
@ -74,6 +74,8 @@ GstRTSPResult gst_rtsp_connection_free (GstRTSPConnection *conn);
|
||||||
|
|
||||||
/* TLS connections */
|
/* TLS connections */
|
||||||
GTlsConnection * gst_rtsp_connection_get_tls (GstRTSPConnection * conn, GError ** error);
|
GTlsConnection * gst_rtsp_connection_get_tls (GstRTSPConnection * conn, GError ** error);
|
||||||
|
gboolean gst_rtsp_connection_set_tls_validation_flags (GstRTSPConnection * conn, GTlsCertificateFlags flags);
|
||||||
|
GTlsCertificateFlags gst_rtsp_connection_get_tls_validation_flags (GstRTSPConnection * conn);
|
||||||
|
|
||||||
|
|
||||||
/* sending/receiving raw bytes */
|
/* sending/receiving raw bytes */
|
||||||
|
|
Loading…
Reference in a new issue