[libsoup] Only set "ssl-ca-file" in examples/get if provided on the commandline



commit ad434349d72831857918f590a2e76010cf086962
Author: Sebastian Dröge <sebastian centricular com>
Date:   Tue Jun 27 22:12:24 2017 +0300

    Only set "ssl-ca-file" in examples/get if provided on the commandline
    
    Otherwise the default system CA database is not going to be used if
    nothing is given on the commandline, and certificate verification fails.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=784259

 examples/get.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/examples/get.c b/examples/get.c
index 60f56f5..f3380b5 100644
--- a/examples/get.c
+++ b/examples/get.c
@@ -228,7 +228,6 @@ main (int argc, char **argv)
        soup_uri_free (parsed);
 
        session = g_object_new (SOUP_TYPE_SESSION,
-                               SOUP_SESSION_SSL_CA_FILE, ca_file,
                                SOUP_SESSION_ADD_FEATURE_BY_TYPE, SOUP_TYPE_CONTENT_DECODER,
                                SOUP_SESSION_ADD_FEATURE_BY_TYPE, SOUP_TYPE_COOKIE_JAR,
                                SOUP_SESSION_USER_AGENT, "get ",
@@ -236,6 +235,8 @@ main (int argc, char **argv)
                                NULL);
        if (ntlm)
                soup_session_add_feature_by_type (session, SOUP_TYPE_AUTH_NTLM);
+       if (ca_file)
+               g_object_set (session, "ssl-ca-file", ca_file, NULL);
 
        if (client_cert_file) {
                GTlsCertificate *client_cert;


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