Skip to content
This repository has been archived by the owner on Apr 4, 2021. It is now read-only.

Truststore

Flowdalic edited this page Jun 5, 2012 · 7 revisions

Code Snippet

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
    connectionConfiguration.setTruststoreType("AndroidCAStore");
    connectionConfiguration.setTruststorePassword(null);
    connectionConfiguration.setTruststorePath(null);
} else {
    connectionConfiguration.setTruststoreType("BKS");
    String path = System.getProperty("javax.net.ssl.trustStore");
    if (path == null)
        path = System.getProperty("java.home") + File.separator + "etc"
            + File.separator + "security" + File.separator
            + "cacerts.bks";
    connectionConfiguration.setTruststorePath(path);
}

MemorizingTrustManager

Georg's memorizing trust manager can be found @ https://github.com/ge0rg/MemorizingTrustManager

Further Readings

Clone this wiki locally