Changeset 12124 in josm for trunk


Ignore:
Timestamp:
2017-05-12T00:57:25+02:00 (7 years ago)
Author:
Don-vip
Message:

fix #13855 - abort HTTPS certificate setup if JDK-8172244 occurs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/PlatformHookWindows.java

    r11943 r12124  
    333333        KeyStore ks = getRootKeystore();
    334334        // Look for certificate to install
    335         String alias = ks.getCertificateAlias(trustedCert.getTrustedCertificate());
    336         if (alias != null) {
    337             // JOSM certificate found, return
    338             Main.debug(tr("JOSM localhost certificate found in {0} keystore: {1}", WINDOWS_ROOT, alias));
     335        try {
     336            String alias = ks.getCertificateAlias(trustedCert.getTrustedCertificate());
     337            if (alias != null) {
     338                // JOSM certificate found, return
     339                Main.debug(tr("JOSM localhost certificate found in {0} keystore: {1}", WINDOWS_ROOT, alias));
     340                return false;
     341            }
     342        } catch (ArrayIndexOutOfBoundsException e) {
     343            // catch error of JDK-8172244 as bug seems to not be fixed anytime soon
     344            Main.error(e, "JDK-8172244 occured. Abort HTTPS setup");
    339345            return false;
    340346        }
Note: See TracChangeset for help on using the changeset viewer.