Summary Files Commits Branches @commit @diff @stats
path: root / badwolf.c
diff options
context:
space:
mode:
1 files changed, 8 insertions, 3 deletions
-rw-r--r--badwolf.c11
diff --git a/badwolf.c b/badwolf.c
index 6ef4cf3..a0a7d09 100644
--- a/badwolf.c
+++ b/badwolf.c
@@ -439,7 +439,8 @@ WebViewCb_load_failed_with_tls_errors(WebKitWebView *web_view,
struct Client *browser = (struct Client *)user_data;
gchar *error_details = detail_tls_certificate_flags(errors);
gint dialog_response;
- SoupURI *failing_uri = soup_uri_new(failing_text);
+
+ GUri *failing_uri = g_uri_parse(failing_text, G_URI_FLAGS_NONE, NULL);
GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(browser->window->main_window),
GTK_DIALOG_MODAL & GTK_DIALOG_DESTROY_WITH_PARENT,
@@ -449,6 +450,10 @@ WebViewCb_load_failed_with_tls_errors(WebKitWebView *web_view,
failing_text);
gtk_dialog_add_buttons(
GTK_DIALOG(dialog), _("Temporarily Add Exception"), 1, _("Continue"), 0, NULL);
+ if(!failing_uri)
+ {
+ gtk_dialog_set_response_sensitive(GTK_DIALOG(dialog), 1, FALSE);
+ }
gtk_dialog_set_default_response(GTK_DIALOG(dialog), 0);
gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog), "%s\n", error_details);
@@ -457,11 +462,11 @@ WebViewCb_load_failed_with_tls_errors(WebKitWebView *web_view,
if(dialog_response == 1)
{
webkit_web_context_allow_tls_certificate_for_host(
- webkit_web_view_get_context(browser->webView), certificate, failing_uri->host);
+ webkit_web_view_get_context(browser->webView), certificate, g_uri_get_host(failing_uri));
webkit_web_view_reload(browser->webView);
}
- soup_uri_free(failing_uri);
+ g_free(failing_uri);
g_free(error_details);
gtk_widget_destroy(dialog);