mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 06:46:38 +00:00
tests: souphttpsrc: Avoid deprecated ssl-ca-file property
SoupSession's ssl-ca-file property is deprecated. Use the recommended tls-database property. This is a bit more complex as it requires creating a GTlsFileDatabase object for an absolute (!) path to the CA certificates file. https://bugzilla.gnome.org/show_bug.cgi?id=784005
This commit is contained in:
parent
9922091f1b
commit
aa8ac28d86
1 changed files with 22 additions and 1 deletions
|
@ -125,8 +125,29 @@ run_test (gboolean use_https, const gchar * path, gint expected)
|
||||||
g_object_set (src, "location", url, NULL);
|
g_object_set (src, "location", url, NULL);
|
||||||
g_free (url);
|
g_free (url);
|
||||||
|
|
||||||
|
if (use_https) {
|
||||||
|
GTlsDatabase *tlsdb;
|
||||||
|
GError *error = NULL;
|
||||||
|
gchar *path;
|
||||||
|
|
||||||
|
/* GTlsFileDatabase needs an absolute path. Using a relative one
|
||||||
|
* causes a warning from GLib-Net followed by a segfault in GnuTLS */
|
||||||
|
if (g_path_is_absolute (ssl_cert_file)) {
|
||||||
|
path = g_strdup (ssl_cert_file);
|
||||||
|
} else {
|
||||||
|
path = g_build_filename (g_get_current_dir (), ssl_cert_file, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
tlsdb = g_tls_file_database_new (path, &error);
|
||||||
|
fail_unless (tlsdb, "Failed to load certificate: %s", error->message);
|
||||||
|
|
||||||
|
g_object_set (src, "tls-database", tlsdb, NULL);
|
||||||
|
|
||||||
|
g_object_unref (tlsdb);
|
||||||
|
g_free (path);
|
||||||
|
}
|
||||||
|
|
||||||
g_object_set (src, "automatic-redirect", redirect, NULL);
|
g_object_set (src, "automatic-redirect", redirect, NULL);
|
||||||
g_object_set (src, "ssl-ca-file", ssl_cert_file, NULL);
|
|
||||||
if (cookies != NULL)
|
if (cookies != NULL)
|
||||||
g_object_set (src, "cookies", cookies, NULL);
|
g_object_set (src, "cookies", cookies, NULL);
|
||||||
g_object_set (sink, "signal-handoffs", TRUE, NULL);
|
g_object_set (sink, "signal-handoffs", TRUE, NULL);
|
||||||
|
|
Loading…
Reference in a new issue