Diff
Modified: trunk/Tools/ChangeLog (232833 => 232834)
--- trunk/Tools/ChangeLog 2018-06-14 07:23:40 UTC (rev 232833)
+++ trunk/Tools/ChangeLog 2018-06-14 08:57:03 UTC (rev 232834)
@@ -1,3 +1,20 @@
+2018-06-14 Zan Dobersek <[email protected]>
+
+ [GTK][WPE] MiniBrowsers should be able to ignore TLS errors
+ https://bugs.webkit.org/show_bug.cgi?id=186557
+
+ Reviewed by Carlos Garcia Campos.
+
+ Add the --ignore-tls-errors flags to the GTK and WPE MiniBrowsers.
+ Enabling the flag enforces ignoring of TLS errors that occur during
+ load. This is primarily useful for loading test cases from the wpt or
+ run-webkit-httpd servers where testing-purpose certificates are used.
+
+ * MiniBrowser/gtk/main.c:
+ (main):
+ * MiniBrowser/wpe/main.cpp:
+ (main):
+
2018-06-13 Adrian Perez de Castro <[email protected]>
[WPE] Trying to access the remote inspector hits an assertion in the UIProcess
Modified: trunk/Tools/MiniBrowser/gtk/main.c (232833 => 232834)
--- trunk/Tools/MiniBrowser/gtk/main.c 2018-06-14 07:23:40 UTC (rev 232833)
+++ trunk/Tools/MiniBrowser/gtk/main.c 2018-06-14 08:57:03 UTC (rev 232834)
@@ -45,6 +45,7 @@
static gboolean privateMode;
static gboolean automationMode;
static gboolean fullScreen;
+static gboolean ignoreTLSErrors;
static const char *cookiesFile;
static const char *cookiesPolicy;
static const char *proxy;
@@ -108,6 +109,7 @@
{ "cookies-policy", 0, 0, G_OPTION_ARG_STRING, &cookiesPolicy, "Cookies accept policy (always, never, no-third-party). Default: no-third-party", "POLICY" },
{ "proxy", 0, 0, G_OPTION_ARG_STRING, &proxy, "Set proxy", "PROXY" },
{ "ignore-host", 0, 0, G_OPTION_ARG_STRING_ARRAY, &ignoreHosts, "Set proxy ignore hosts", "HOSTS" },
+ { "ignore-tls-errors", 0, 0, G_OPTION_ARG_NONE, &ignoreTLSErrors, "Ignore TLS errors", NULL },
{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &uriArguments, 0, "[URL…]" },
{ 0, 0, 0, 0, 0, 0, 0 }
};
@@ -535,6 +537,9 @@
webkit_web_context_set_automation_allowed(webContext, automationMode);
g_signal_connect(webContext, "automation-started", G_CALLBACK(automationStartedCallback), NULL);
+ if (ignoreTLSErrors)
+ webkit_web_context_set_tls_errors_policy(webContext, WEBKIT_TLS_ERRORS_POLICY_IGNORE);
+
BrowserWindow *mainWindow = BROWSER_WINDOW(browser_window_new(NULL, webContext));
if (fullScreen)
gtk_window_fullscreen(GTK_WINDOW(mainWindow));
Modified: trunk/Tools/MiniBrowser/wpe/main.cpp (232833 => 232834)
--- trunk/Tools/MiniBrowser/wpe/main.cpp 2018-06-14 07:23:40 UTC (rev 232833)
+++ trunk/Tools/MiniBrowser/wpe/main.cpp 2018-06-14 08:57:03 UTC (rev 232834)
@@ -36,6 +36,7 @@
static gboolean headlessMode;
static gboolean privateMode;
static gboolean automationMode;
+static gboolean ignoreTLSErrors;
static const char* cookiesFile;
static const char* cookiesPolicy;
static const char* proxy;
@@ -49,6 +50,7 @@
{ "cookies-policy", 0, 0, G_OPTION_ARG_STRING, &cookiesPolicy, "Cookies accept policy (always, never, no-third-party). Default: no-third-party", "POLICY" },
{ "proxy", 0, 0, G_OPTION_ARG_STRING, &proxy, "Set proxy", "PROXY" },
{ "ignore-host", 0, 0, G_OPTION_ARG_STRING_ARRAY, &ignoreHosts, "Set proxy ignore hosts", "HOSTS" },
+ { "ignore-tls-errors", 0, 0, G_OPTION_ARG_NONE, &ignoreTLSErrors, "Ignore TLS errors", nullptr },
{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &uriArguments, nullptr, "[URL]" },
{ nullptr, 0, 0, G_OPTION_ARG_NONE, nullptr, nullptr, nullptr }
};
@@ -180,6 +182,9 @@
webkit_web_context_set_automation_allowed(webContext, automationMode);
g_signal_connect(webContext, "automation-started", G_CALLBACK(automationStartedCallback), webView);
+ if (ignoreTLSErrors)
+ webkit_web_context_set_tls_errors_policy(webContext, WEBKIT_TLS_ERRORS_POLICY_IGNORE);
+
if (uriArguments)
webkit_web_view_load_uri(webView, uriArguments[0]);
else if (!automationMode)