String defaultAlgorithm = TrustManagerFactory.getDefaultAlgorithm();
TrustManagerFactory tmf = TrustManagerFactory.getInstance(defaultAlgorithm);
String defaultKeystoreType = KeyStore.getDefaultType();
tmf.init(KeyStore.getInstance(defaultKeystoreType));
TrustManager[] tms = tmf.getTrustManagers();
for (TrustManager tm : tms) {
if (tm instanceof X509TrustManager) {
new X509TrustManagerExtensions((X509TrustManager)tm);
return;
}
}
fail();