summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrant Gayed <ggayed>2010-01-04 19:36:56 +0000
committerGrant Gayed <ggayed>2010-01-04 19:36:56 +0000
commit3bedaa97578a4d5960bc85896fe24ba76d1c94be (patch)
tree979be3f61b024b29cddf6e05f9df1c5e1ed81ea2
parentfc3d7386b84a81be78f37b4bb7bee653719311a3 (diff)
downloadeclipse.platform.swt-3bedaa97578a4d5960bc85896fe24ba76d1c94be.tar.gz
eclipse.platform.swt-3bedaa97578a4d5960bc85896fe24ba76d1c94be.tar.xz
eclipse.platform.swt-3bedaa97578a4d5960bc85896fe24ba76d1c94be.zip
297605 - No Invalid Certificate dialog prompt when sec_error_ca_cert_invalid
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptService2.java21
1 files changed, 15 insertions, 6 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptService2.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptService2.java
index 47f46598d4..b1c74b28b2 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptService2.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptService2.java
@@ -21,6 +21,17 @@ class PromptService2 {
XPCOMObject promptService2;
int refCount = 0;
+ static final String[] certErrorCodes = new String[] {
+ "ssl_error_bad_cert_domain",
+ "sec_error_ca_cert_invalid",
+ "sec_error_expired_certificate",
+ "sec_error_expired_issuer_certificate",
+ "sec_error_inadequate_key_usage",
+ "sec_error_unknown_issuer",
+ "sec_error_untrusted_cert",
+ "sec_error_untrusted_issuer",
+ }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$
+
PromptService2 () {
createCOMInterfaces ();
}
@@ -169,17 +180,15 @@ int Alert (int /*long*/ aParent, int /*long*/ aDialogTitle, int /*long*/ aText)
* detected then instead of showing it, re-navigate to the page with the invalid
* certificate so that the browser's nsIBadCertListener2 will be invoked.
*/
- if (textLabel.indexOf ("ssl_error_bad_cert_domain") != -1 ||
- textLabel.indexOf ("sec_error_ca_cert_invalid") != -1 ||
- textLabel.indexOf ("sec_error_unknown_issuer") != -1 ||
- textLabel.indexOf ("sec_error_untrusted_issuer") != -1 ||
- textLabel.indexOf ("sec_error_expired_certificate") != -1) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- if (browser != null) {
+ if (browser != null) {
+ for (int i = 0; i < certErrorCodes.length; i++) {
+ if (textLabel.indexOf (certErrorCodes[i]) != -1) {
Mozilla mozilla = (Mozilla)browser.webBrowser;
mozilla.isRetrievingBadCert = true;
browser.setUrl (mozilla.lastNavigateURL);
return XPCOM.NS_OK;
}
+ }
}
Shell shell = browser == null ? new Shell () : browser.getShell ();