]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
webkit2: Avoid deprecated function call
authorJouni Malinen <quic_jouni@quicinc.com>
Thu, 23 Feb 2023 14:30:04 +0000 (16:30 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 23 Feb 2023 14:30:04 +0000 (16:30 +0200)
webkit_web_context_set_tls_errors_policy() has been deprecated. Use its
replacement webkit_website_data_manager_set_tls_errors_policy() when
building against sufficiently recent version of webkit2.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
src/utils/browser.c

index c0f4380c4e3844dd427528f2b9b695522a55e7f3..b5d5ba78f26475dd7d73727642d5301f8e82b92d 100644 (file)
@@ -370,11 +370,21 @@ int hs20_web_browser(const char *url, int ignore_tls)
 
 #ifdef USE_WEBKIT2
        if (ignore_tls) {
+#if WEBKIT_CHECK_VERSION(2, 32, 0)
+               WebKitWebContext *wkctx;
+               WebKitWebsiteDataManager *wkmgr;
+
+               wkctx = webkit_web_context_get_default();
+               wkmgr = webkit_web_context_get_website_data_manager(wkctx);
+               webkit_website_data_manager_set_tls_errors_policy(
+                       wkmgr, WEBKIT_TLS_ERRORS_POLICY_IGNORE);
+#else
                WebKitWebContext *wkctx;
 
                wkctx = webkit_web_context_get_default();
                webkit_web_context_set_tls_errors_policy(
                        wkctx, WEBKIT_TLS_ERRORS_POLICY_IGNORE);
+#endif
        }
 #endif /* USE_WEBKIT2 */