diff options
author | Quentin Rameau <quinq@fifth.space> | 2015-11-18 18:44:25 +0100 |
---|---|---|
committer | Quentin Rameau <quinq@fifth.space> | 2015-11-20 00:34:20 +0100 |
commit | 58c4e189758d829c418bd3a0e30646e533131487 (patch) | |
tree | 589b4370a3fbb47db29a259d36c7d30048cfe9aa | |
parent | e9ec482049972d8b6b0c73faf452666b3cc32520 (diff) | |
download | surf-58c4e189758d829c418bd3a0e30646e533131487.tar.gz surf-58c4e189758d829c418bd3a0e30646e533131487.tar.bz2 surf-58c4e189758d829c418bd3a0e30646e533131487.zip |
Manage ssl errors with GTlsCertificateFlags
Keep a GTlsCertificateFlags in Client for TLS errors.
If we don't use a ssl connection, set it to a value greater than maximum
error flag value (which is G_TLS_CERTIFICATE_VALIDATE_ALL for all
possible errors).
-rw-r--r-- | surf.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -60,11 +60,12 @@ typedef struct Client { WebKitWebView *view; WebKitWebInspector *inspector; WebKitHitTestResult *mousepos; + GTlsCertificateFlags tlsflags; const char *title, *targeturi; const char *needle; gint progress; struct Client *next; - gboolean zoomed, fullscreen, isinspecting, sslfailed; + gboolean zoomed, fullscreen, isinspecting; } Client; typedef struct { @@ -896,6 +897,7 @@ newclient(Client *rc) clients = c; c->view = newview(c, rc ? rc->view : NULL); + c->tlsflags = G_TLS_CERTIFICATE_VALIDATE_ALL + 1; return c; } @@ -1518,11 +1520,8 @@ getpagestat(Client *c) { const char *uri = geturi(c); - if (strstr(uri, "https://") == uri) - pagestat[0] = c->sslfailed ? 'U' : 'T'; - else - pagestat[0] = '-'; - + pagestats[0] = c->tlsflags > G_TLS_CERTIFICATE_VALIDATE_ALL ? '-' : + c->tlsflags > 0 ? 'U' : 'T'; pagestat[1] = '\0'; } |