297605 - No Invalid Certificate dialog prompt when sec_error_ca_cert_invalid
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 d9b4612..6c93bb9 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 @@
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 @@
* 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 ();