tReplacing the deprecated ssl-ca-file with tls-database. - surf - customized build of surf, the suckless webkit browser
 (HTM) git clone git://src.adamsgaard.dk/surf
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit e4869357f1c625a2b56ca1327ed8c89864341d77
 (DIR) parent a78aec66302f36341ab44ef2fbb7d7555eeb755c
 (HTM) Author: Christoph Lohmann <20h@r-36.net>
       Date:   Thu, 30 Jan 2014 19:39:32 +0100
       
       Replacing the deprecated ssl-ca-file with tls-database.
       
       Thanks Steve Dee <mrdomino@gmail.com>!
       
       Diffstat:
         M surf.c                              |      10 +++++++++-
       
       1 file changed, 9 insertions(+), 1 deletion(-)
       ---
 (DIR) diff --git a/surf.c b/surf.c
       t@@ -80,6 +80,7 @@ static char winid[64];
        static gboolean usingproxy = 0;
        static char togglestat[7];
        static char pagestat[3];
       +static GTlsDatabase *tlsdb;
        
        static void addaccelgroup(Client *c);
        static void beforerequest(WebKitWebView *w, WebKitWebFrame *f,
       t@@ -1044,6 +1045,7 @@ setup(void) {
                char *new_proxy;
                SoupURI *puri;
                SoupSession *s;
       +        GError *error = NULL;
        
                /* clean up any zombies immediately */
                sigchld(0);
       t@@ -1070,7 +1072,13 @@ setup(void) {
                                                FALSE)));
        
                /* ssl */
       -        g_object_set(G_OBJECT(s), "ssl-ca-file", cafile, NULL);
       +        tlsdb = g_tls_file_database_new(cafile, &error);
       +
       +        if (error) {
       +                g_warning("Error loading SSL database %s: %s", cafile, error->message);
       +                g_error_free(error);
       +        }
       +        g_object_set(G_OBJECT(s), "tls-database", tlsdb, NULL);
                g_object_set(G_OBJECT(s), "ssl-strict", strictssl, NULL);
        
                /* proxy */