{
if (keystore == null) {
throw new IllegalArgumentException(Messages.getString("SSLFactory.error.null.keystore")); //$NON-NLS-1$
}
LOG.debug(Messages.getString("SSLFactory.init.trust.manager")); //$NON-NLS-1$
TrustManagerFactory tmfactory = TrustManagerFactory.getInstance(
TrustManagerFactory.getDefaultAlgorithm());
tmfactory.init(keystore);
TrustManager[] trustmanagers = tmfactory.getTrustManagers();
for (int i = 0; i < trustmanagers.length; i++) {
if (trustmanagers[i] instanceof X509TrustManager) {
trustmanagers[i] = new AuthSSLX509TrustManager(
(X509TrustManager)trustmanagers[i]);
}