Usage examples tls-interaction property for rtspsrc and souphttpsrc
enthusiastic geek
enthusiasticgeek at gmail.com
Sun Oct 8 19:51:02 UTC 2017
Thanks @Mandar Joshi.
I was able to get this to work.
I did modify the following function in server side. Obviously it doesn't do
peer verification but it works
gboolean
accept_certificate (GstRTSPAuth *auth,
GTlsConnection *conn,
GTlsCertificate *peer_cert,
GTlsCertificateFlags errors,
gpointer user_data) {
GError *error = NULL;
gboolean accept = FALSE;
GTlsCertificate *ca_tls_cert = (GTlsCertificate *) user_data;
GTlsDatabase* database = g_tls_file_database_new
("/home/virgo/gstreamer/cert/toyCA.pem", &error);
if (database) {
GSocketConnectable *peer_identity;
GTlsCertificateFlags validation_flags;
g_debug ("TLS peer certificate not accepted, checking user
database...\n");
peer_identity = NULL;
errors =
g_tls_database_verify_chain (database, peer_cert,
G_TLS_DATABASE_PURPOSE_AUTHENTICATE_CLIENT, peer_identity,
g_tls_connection_get_interaction (conn), G_TLS_DATABASE_VERIFY_NONE,
NULL, &error);
g_print("errors value %d\n",errors);
g_object_unref (database);
if (error)
{
g_warning ("failure verifying certificate chain: %s",
error->message);
g_assert (errors != 0);
g_clear_error (&error);
}
}
if (error == 0){
return TRUE;
}
return FALSE;
}
--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
More information about the gstreamer-devel
mailing list