From eeeba03717a64d0750ccccdecae756f61260e087 Mon Sep 17 00:00:00 2001 From: Carlos Garcia Campos Date: Fri, 13 Jul 2012 09:46:58 +0200 Subject: ephy-web-view: Port security level to WebKit2 https://bugzilla.gnome.org/show_bug.cgi?id=679371 --- embed/ephy-web-view.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'embed/ephy-web-view.c') 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); -- cgit