summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Carl <danielcarl@gmx.de>2021-12-28 00:18:26 +0100
committerrafa_99 <raroma09@gmail.com>2022-01-01 20:30:55 +0000
commit95e71fc0de5dd0cf87270678c957e54160ec25ad (patch)
treec63c2ffbf6b5b4781110707559608b36f8f323e1
parent7ce78b9571ac6c4a5d8a17957528849eebafb480 (diff)
Set ssl policy on website data manager.
This fixes deprecation warning on compile.
-rw-r--r--src/setting.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/setting.c b/src/setting.c
index e081757..4fe0ce4 100644
--- a/src/setting.c
+++ b/src/setting.c
@@ -770,9 +770,16 @@ static int tls_policy(Client *c, const char *name, DataType type, void *value, v
{
gboolean strict = *((gboolean*)value);
+#if WEBKIT_CHECK_VERSION(2, 30, 0)
+ WebKitWebContext *ctx = webkit_web_view_get_context(c->webview);
+ WebKitWebsiteDataManager *manager = webkit_web_context_get_website_data_manager(ctx);
+ webkit_website_data_manager_set_tls_errors_policy(manager,
+ strict ? WEBKIT_TLS_ERRORS_POLICY_FAIL : WEBKIT_TLS_ERRORS_POLICY_IGNORE);
+#else
webkit_web_context_set_tls_errors_policy(
webkit_web_context_get_default(),
strict ? WEBKIT_TLS_ERRORS_POLICY_FAIL : WEBKIT_TLS_ERRORS_POLICY_IGNORE);
+#endif
return CMD_SUCCESS;
}