]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
hs20-osu-client: Ignore TLS errors with webkit2
authorBen Greear <greearb@candelatech.com>
Fri, 7 Feb 2020 09:10:16 +0000 (01:10 -0800)
committerJouni Malinen <j@w1.fi>
Sun, 16 Feb 2020 15:40:52 +0000 (17:40 +0200)
Hopefully this helps with self-signed certificates. This matches the
older behavior with webkit.

Signed-off-by: Ben Greear <greearb@candelatech.com>
src/utils/browser.c

index 43d47dca3a2a79321a39a979e431e707f71848a7..50452362541fb36c7d0f52345268f57999313d95 100644 (file)
@@ -213,6 +213,7 @@ int hs20_web_browser(const char *url)
        WebKitWebView *view;
 #ifdef USE_WEBKIT2
        WebKitSettings *settings;
        WebKitWebView *view;
 #ifdef USE_WEBKIT2
        WebKitSettings *settings;
+       WebKitWebContext *wkctx;
 #else /* USE_WEBKIT2 */
        WebKitWebSettings *settings;
        SoupSession *s;
 #else /* USE_WEBKIT2 */
        WebKitWebSettings *settings;
        SoupSession *s;
@@ -284,6 +285,12 @@ int hs20_web_browser(const char *url)
                     "hs20-client/1.0", NULL);
        g_object_set(G_OBJECT(settings), "auto-load-images", TRUE, NULL);
 
                     "hs20-client/1.0", NULL);
        g_object_set(G_OBJECT(settings), "auto-load-images", TRUE, NULL);
 
+#ifdef USE_WEBKIT2
+       wkctx = webkit_web_context_get_default();
+       webkit_web_context_set_tls_errors_policy(
+               wkctx, WEBKIT_TLS_ERRORS_POLICY_IGNORE);
+#endif /* USE_WEBKIT2 */
+
        webkit_web_view_load_uri(view, url);
 
        gtk_main();
        webkit_web_view_load_uri(view, url);
 
        gtk_main();