mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 04:31:06 +00:00
tests: souphttpsrc: Avoid deprecated server ssl properties
The ssl-cert-file and ssl-key-file properties are deprecated. Use the soup_server_set_ssl_cert_file function to load the files. https://bugzilla.gnome.org/show_bug.cgi?id=784005
This commit is contained in:
parent
27a0ea8cf5
commit
9922091f1b
1 changed files with 13 additions and 8 deletions
|
@ -569,25 +569,30 @@ get_port_from_server (SoupServer * server)
|
|||
static SoupServer *
|
||||
run_server (gboolean use_https)
|
||||
{
|
||||
SoupServer *server;
|
||||
SoupServerListenOptions listen_flags;
|
||||
SoupServer *server = soup_server_new (NULL, NULL);
|
||||
SoupServerListenOptions listen_flags = 0;
|
||||
guint port;
|
||||
|
||||
|
||||
if (use_https) {
|
||||
GTlsBackend *backend = g_tls_backend_get_default ();
|
||||
GError *err = NULL;
|
||||
|
||||
if (backend == NULL || !g_tls_backend_supports_tls (backend)) {
|
||||
GST_INFO ("No TLS support");
|
||||
g_object_unref (server);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
server = soup_server_new (SOUP_SERVER_SSL_CERT_FILE, ssl_cert_file,
|
||||
SOUP_SERVER_SSL_KEY_FILE, ssl_key_file, NULL);
|
||||
listen_flags = SOUP_SERVER_LISTEN_HTTPS;
|
||||
} else {
|
||||
server = soup_server_new (NULL, NULL);
|
||||
listen_flags = 0;
|
||||
if (!soup_server_set_ssl_cert_file (server, ssl_cert_file, ssl_key_file,
|
||||
&err)) {
|
||||
GST_INFO ("Failed to load certificate: %s", err->message);
|
||||
g_object_unref (server);
|
||||
g_error_free (err);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
listen_flags |= SOUP_SERVER_LISTEN_HTTPS;
|
||||
}
|
||||
|
||||
soup_server_add_handler (server, NULL, server_callback, NULL, NULL);
|
||||
|
|
Loading…
Reference in a new issue