Using the provider string when creating the SSLContext in case of no

keystore.
This commit is contained in:
Simone Bordet 2015-01-06 17:29:44 +01:00
parent b1f1ebcc72
commit 3abfbe26b3
1 changed files with 2 additions and 2 deletions

View File

@ -258,7 +258,7 @@ public class SslContextFactory extends AbstractLifeCycle
}
SecureRandom secureRandom = (_secureRandomAlgorithm == null)?null:SecureRandom.getInstance(_secureRandomAlgorithm);
SSLContext context = SSLContext.getInstance(_sslProtocol);
SSLContext context = _sslProvider == null ? SSLContext.getInstance(_sslProtocol) : SSLContext.getInstance(_sslProtocol, _sslProvider);
context.init(null, trust_managers, secureRandom);
_context = context;
}
@ -299,7 +299,7 @@ public class SslContextFactory extends AbstractLifeCycle
TrustManager[] trustManagers = getTrustManagers(trustStore,crls);
SecureRandom secureRandom = (_secureRandomAlgorithm == null)?null:SecureRandom.getInstance(_secureRandomAlgorithm);
SSLContext context = _sslProvider == null ? SSLContext.getInstance(_sslProtocol) : SSLContext.getInstance(_sslProtocol,_sslProvider);
SSLContext context = _sslProvider == null ? SSLContext.getInstance(_sslProtocol) : SSLContext.getInstance(_sslProtocol, _sslProvider);
context.init(keyManagers,trustManagers,secureRandom);
_context = context;
}