diff options
author | Carlos Garcia Campos <cgarcia@igalia.com> | 2012-07-13 15:46:58 +0800 |
---|---|---|
committer | Carlos Garcia Campos <carlosgc@gnome.org> | 2012-07-13 17:56:14 +0800 |
commit | eeeba03717a64d0750ccccdecae756f61260e087 (patch) | |
tree | 24aed6c4817bfa723f037cc4204e317b1e4374db /embed | |
parent | ff1131c9b138b6218bf94f2bcaf6f721bc94a1b1 (diff) | |
download | gsoc2013-epiphany-eeeba03717a64d0750ccccdecae756f61260e087.tar.gz gsoc2013-epiphany-eeeba03717a64d0750ccccdecae756f61260e087.tar.zst gsoc2013-epiphany-eeeba03717a64d0750ccccdecae756f61260e087.zip |
ephy-web-view: Port security level to WebKit2
https://bugzilla.gnome.org/show_bug.cgi?id=679371
Diffstat (limited to 'embed')
-rw-r--r-- | embed/ephy-web-view.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c index a6c28f097..737c233c9 100644 --- a/embed/ephy-web-view.c +++ b/embed/ephy-web-view.c @@ -2141,24 +2141,18 @@ load_changed_cb (WebKitWebView *web_view, /* Security status. */ if (uri && g_str_has_prefix (uri, "https")) { -#if 0 - /* TODO: security */ - WebKitWebFrame *frame; - WebKitWebDataSource *source; - WebKitNetworkRequest *request; - SoupMessage *message; - - frame = webkit_web_view_get_main_frame (WEBKIT_WEB_VIEW(view)); - source = webkit_web_frame_get_data_source (frame); - request = webkit_web_data_source_get_request (source); - message = webkit_network_request_get_message (request); - - if (message && - (soup_message_get_flags (message) & SOUP_MESSAGE_CERTIFICATE_TRUSTED)) + WebKitWebResource *resource; + WebKitURIResponse *response; + GTlsCertificateFlags tls_errors = 0; + gboolean has_certificate; + + resource = webkit_web_view_get_main_resource (web_view); + response = webkit_web_resource_get_response (resource); + has_certificate = webkit_uri_response_get_https_status (response, NULL, &tls_errors); + if (has_certificate && tls_errors == 0) security_level = EPHY_WEB_VIEW_STATE_IS_SECURE_HIGH; else security_level = EPHY_WEB_VIEW_STATE_IS_BROKEN; -#endif } ephy_web_view_set_security_level (EPHY_WEB_VIEW (web_view), security_level); |