From fb2fddb3ed7e5a8c51d928bfe8be6f3e198d4a02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Tue, 8 Oct 2013 15:57:54 +0200 Subject: SoupServer: check only for tls-certificate to know if a server is running plain http or https We can check only for "tls-certificate", once it's set whether "ssl-cert-file" and "ssl-key-file" are set. https://bugzilla.gnome.org/show_bug.cgi?id=709647 --- libsoup/soup-server.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libsoup/soup-server.c b/libsoup/soup-server.c index abda60ba..3d3070a2 100644 --- a/libsoup/soup-server.c +++ b/libsoup/soup-server.c @@ -788,7 +788,8 @@ soup_server_get_port (SoupServer *server) * * In order for a server to run https, you must set the * %SOUP_SERVER_SSL_CERT_FILE and %SOUP_SERVER_SSL_KEY_FILE properties - * to provide it with an SSL certificate to use. + * or %SOUP_SERVER_TLS_CERTIFICATE property to provide it with an SSL + * certificate to use. * * Return value: %TRUE if @server is serving https. **/ @@ -800,7 +801,7 @@ soup_server_is_https (SoupServer *server) g_return_val_if_fail (SOUP_IS_SERVER (server), 0); priv = SOUP_SERVER_GET_PRIVATE (server); - return (priv->ssl_cert_file && priv->ssl_key_file); + return priv->ssl_cert != NULL; } /** -- cgit v1.2.1