Changeset 13693 in josm


Ignore:
Timestamp:
2018-05-01T15:58:03+02:00 (3 weeks ago)
Author:
Don-vip
Message:

fix #15851 - search certificates in /etc/ssl/certs

File:
1 edited

Legend:

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

    r13647 r13693  
    402402    public X509Certificate getX509Certificate(NativeCertAmend certAmend)
    403403            throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException {
    404         File f = new File("/usr/share/ca-certificates/mozilla", certAmend.getFilename());
    405         if (f.exists()) {
    406             CertificateFactory fact = CertificateFactory.getInstance("X.509");
    407             try (InputStream is = Files.newInputStream(f.toPath())) {
    408                 return (X509Certificate) fact.generateCertificate(is);
     404        for (String dir : new String[] {"/etc/ssl/certs", "/usr/share/ca-certificates/mozilla"}) {
     405            File f = new File(dir, certAmend.getFilename());
     406            if (f.exists()) {
     407                CertificateFactory fact = CertificateFactory.getInstance("X.509");
     408                try (InputStream is = Files.newInputStream(f.toPath())) {
     409                    return (X509Certificate) fact.generateCertificate(is);
     410                }
    409411            }
    410412        }
Note: See TracChangeset for help on using the changeset viewer.