X509TrustManager () { try { if (myFactory != null && myKeyStore != null) { myFactory.init(myKeyStore); final TrustManager[] trustManagers = myFactory.getTrustManagers(); final X509TrustManager result = findX509TrustManager(trustManagers); if (result == null) { LOG.error("Cannot find X509 trust manager among " + Arrays.toString(trustManagers)); } return result; } } catch (KeyStoreException e) { LOG.error("Cannot initialize trust store", e); } return null; }