[libsoup] SoupServer: check only for tls-certificate to know if a server is running plain http or https



commit fb2fddb3ed7e5a8c51d928bfe8be6f3e198d4a02
Author: Fabiano FidĂȘncio <fabiano fidencio org>
Date:   Tue Oct 8 15:57:54 2013 +0200

    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 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/libsoup/soup-server.c b/libsoup/soup-server.c
index abda60b..3d3070a 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;
 }
 
 /**


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]