Summary Files Commits Branches @commit @diff @stats
path: root / badwolf.c
diff options
context:
space:
mode:
Commit0dd04a60bf19738302702e81e53ed896484f24cb (patch)
Author
 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
2021-10-03 09:45:30 +0200
Committer
 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
2021-10-03 10:19:19 +0200
Files0656742ccf20b0d0b0d0630e76da06061a3452d3 /badwolf.c
goodwolf-0dd04a60bf19738302702e81e53ed896484f24cb.tar
goodwolf-0dd04a60bf19738302702e81e53ed896484f24cb.tar.gz
goodwolf-0dd04a60bf19738302702e81e53ed896484f24cb.zip
Parentf539edf6f68be78e7be36a94f5020a6193f58867 (diff)
Fallback to libsoup2 for systems with glib-2.0 <2.66.0
This is the case on Ubuntu 20.04 for example.
1 files changed, 13 insertions, 0 deletions
-rw-r--r--badwolf.c13
diff --git a/badwolf.c b/badwolf.c
index a0a7d09..4c5a481 100644
--- a/badwolf.c
+++ b/badwolf.c
@@ -440,7 +440,11 @@ WebViewCb_load_failed_with_tls_errors(WebKitWebView *web_view,
gchar *error_details = detail_tls_certificate_flags(errors);
gint dialog_response;
+#ifndef USE_LIBSOUP2
GUri *failing_uri = g_uri_parse(failing_text, G_URI_FLAGS_NONE, NULL);
+#else
+ SoupURI *failing_uri = soup_uri_new(failing_text);
+#endif
GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(browser->window->main_window),
GTK_DIALOG_MODAL & GTK_DIALOG_DESTROY_WITH_PARENT,
@@ -461,12 +465,21 @@ WebViewCb_load_failed_with_tls_errors(WebKitWebView *web_view,
if(dialog_response == 1)
{
+#ifndef USE_LIBSOUP2
webkit_web_context_allow_tls_certificate_for_host(
webkit_web_view_get_context(browser->webView), certificate, g_uri_get_host(failing_uri));
+#else
+ webkit_web_context_allow_tls_certificate_for_host(
+ webkit_web_view_get_context(browser->webView), certificate, failing_uri->host);
+#endif
webkit_web_view_reload(browser->webView);
}
+#ifndef USE_LIBSOUP2
g_free(failing_uri);
+#else
+ soup_uri_free(failing_uri);
+#endif
g_free(error_details);
gtk_widget_destroy(dialog);