summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabiano FidĂȘncio <fabiano@fidencio.org>2013-10-08 15:57:54 +0200
committerDan Winship <danw@gnome.org>2013-10-08 12:22:40 -0400
commitfb2fddb3ed7e5a8c51d928bfe8be6f3e198d4a02 (patch)
tree0ab13325ec647e5ad5707feff3d1fac1559dc194
parentd1cb3455a7278a7a5d8ac770852ae489a54e6452 (diff)
downloadlibsoup-fb2fddb3ed7e5a8c51d928bfe8be6f3e198d4a02.tar.gz
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
-rw-r--r--libsoup/soup-server.c5
1 files 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;
}
/**