After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 754825 - Allow to set SoupSession::ssl-ca-file to NULL
Allow to set SoupSession::ssl-ca-file to NULL
Status: RESOLVED OBSOLETE
Product: libsoup
Classification: Core
Component: API
2.51.x
Other Linux
: Normal normal
: ---
Assigned To: libsoup-maint@gnome.bugs
libsoup-maint@gnome.bugs
Depends on:
Blocks:
 
 
Reported: 2015-09-10 11:31 UTC by Christophe Fergeau
Modified: 2018-09-21 16:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Allow to set NULL SoupSession::ssl-ca-file (3.59 KB, patch)
2015-09-10 11:32 UTC, Christophe Fergeau
none Details | Review
ssl-ca: Add additional test (1.93 KB, patch)
2015-09-10 11:32 UTC, Christophe Fergeau
none Details | Review

Description Christophe Fergeau 2015-09-10 11:31:26 UTC
It's currently not possible to set SoupSession::ssl-ca-file to NULL, this patch series fix that.
Comment 1 Christophe Fergeau 2015-09-10 11:32:25 UTC
Created attachment 311059 [details] [review]
Allow to set NULL SoupSession::ssl-ca-file
Comment 2 Christophe Fergeau 2015-09-10 11:32:46 UTC
Created attachment 311060 [details] [review]
ssl-ca: Add additional test
Comment 3 Dan Winship 2015-09-10 18:05:10 UTC
For a legacy SoupSession type, it's not clear that ssl-ca-file=NULL should imply ssl-use-system-ca-file=TRUE, given that the default value of the properties is ssl-ca-file=NULL, ssl-use-system-ca-file=FALSE.

That is part of why this property is deprecated. Is there some reason you're using it? If you're setting it from some other value provided from elsewhere, the preferred way to do it is:

    if (ssl_ca_file != NULL) {
        tlsdb = g_tls_file_database_new (ssl_ca_file, &error);
        // error handling here
    } else
        tlsdb = NULL;
    g_object_set (session, SOUP_SESSION_TLS_DATABASE, tlsdb, NULL);

In particular because of the "// error handling here", which you can't do with ssl-ca-file.
Comment 4 Christophe Fergeau 2015-09-11 07:28:51 UTC
I'm using ssl-ca-file for el6 support as ssl-use-system-ca-file and tls-database are available since libsoup 2.38 while el6 only has 2.34. What I'm trying to achieve is to try a connection with a given CA, and if this fails, try again with the system CAs.
Maybe the right way of handling that is to ask for a backport of ssl-use-system-ca-file and tls-database in el6.
Comment 5 Dan Winship 2015-09-14 13:50:37 UTC
Ah, this patch is definitely wrong then; setting ssl-ca-file=NULL in 2.34 doesn't mean "use system CAs", it means "use no CAs" (and just accept any certificate). If you want to use the system CAs, you have to explicitly set it to the path of the system CA file.
Comment 6 GNOME Infrastructure Team 2018-09-21 16:23:16 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/libsoup/issues/85.