Ignore:
Timestamp:
2017-05-23T18:31:31+02:00 (2 years ago)
Author:
Don-vip
Message:

see #11924, see #14649 - java 9 does not seem to include Dutch certificates yet, load them from /usr/share/ca-certificates/mozilla (see Debian ca-certificates package)

File:
1 edited

Legend:

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

    r12239 r12241  
    88import java.io.BufferedReader;
    99import java.io.File;
     10import java.io.FileInputStream;
    1011import java.io.IOException;
    1112import java.net.URI;
     
    1516import java.nio.file.Path;
    1617import java.nio.file.Paths;
     18import java.security.KeyStoreException;
     19import java.security.NoSuchAlgorithmException;
     20import java.security.cert.CertificateException;
     21import java.security.cert.CertificateFactory;
     22import java.security.cert.X509Certificate;
    1723import java.util.Arrays;
    1824import java.util.List;
     
    2026
    2127import org.openstreetmap.josm.Main;
     28import org.openstreetmap.josm.io.CertificateAmendment.CertAmend;
    2229
    2330/**
     
    418425        return Arrays.asList(new File("/usr/local/share/proj"), new File("/usr/share/proj"));
    419426    }
     427
     428    @Override
     429    public X509Certificate getX509Certificate(CertAmend certAmend)
     430            throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException {
     431        File f = new File("/usr/share/ca-certificates/mozilla", certAmend.getFilename());
     432        if (f.exists()) {
     433            CertificateFactory fact = CertificateFactory.getInstance("X.509");
     434            try (FileInputStream is = new FileInputStream(f)) {
     435                return (X509Certificate) fact.generateCertificate(is);
     436            }
     437        }
     438        return null;
     439    }
    420440}
Note: See TracChangeset for help on using the changeset viewer.