467281 Remove Java 1.7 support from Jetty 9.3
This commit is contained in:
parent
dc3b4d01f4
commit
f3601267c4
|
@ -269,8 +269,7 @@ public class SslContextFactory extends AbstractLifeCycle
|
|||
if (context == null)
|
||||
{
|
||||
// Is this an empty factory?
|
||||
if (keyStore==null && _keyStoreResource == null &&
|
||||
trustStore==null && _trustStoreResource == null )
|
||||
if (keyStore==null && _keyStoreResource == null && trustStore==null && _trustStoreResource == null )
|
||||
{
|
||||
TrustManager[] trust_managers=null;
|
||||
|
||||
|
@ -317,30 +316,13 @@ public class SslContextFactory extends AbstractLifeCycle
|
|||
validator.validate(keyStore, cert);
|
||||
}
|
||||
|
||||
KeyManager[] keyManagers = getKeyManagers(keyStore);
|
||||
TrustManager[] trustManagers = getTrustManagers(trustStore,crls);
|
||||
|
||||
SecureRandom secureRandom = (_secureRandomAlgorithm == null)?null:SecureRandom.getInstance(_secureRandomAlgorithm);
|
||||
context = _sslProvider == null ? SSLContext.getInstance(_sslProtocol) : SSLContext.getInstance(_sslProtocol, _sslProvider);
|
||||
context.init(keyManagers,trustManagers,secureRandom);
|
||||
}
|
||||
}
|
||||
|
||||
_factory = new Factory(keyStore,trustStore,context);
|
||||
SSLEngine engine = newSSLEngine();
|
||||
if (LOG.isDebugEnabled())
|
||||
{
|
||||
LOG.debug("Enabled Protocols {} of {}",Arrays.asList(engine.getEnabledProtocols()),Arrays.asList(engine.getSupportedProtocols()));
|
||||
LOG.debug("Enabled Ciphers {} of {}",Arrays.asList(engine.getEnabledCipherSuites()),Arrays.asList(engine.getSupportedCipherSuites()));
|
||||
}
|
||||
|
||||
// Look for X.509 certificates to create alias map
|
||||
_certAliases.clear();
|
||||
if (_factory._keyStore!=null)
|
||||
if (keyStore!=null)
|
||||
{
|
||||
loop: for (String alias : Collections.list(_factory._keyStore.aliases()))
|
||||
loop: for (String alias : Collections.list(keyStore.aliases()))
|
||||
{
|
||||
Certificate certificate = _factory._keyStore.getCertificate(alias);
|
||||
Certificate certificate = keyStore.getCertificate(alias);
|
||||
if ("X.509".equals(certificate.getType()))
|
||||
{
|
||||
X509Certificate x509 = (X509Certificate)certificate;
|
||||
|
@ -364,7 +346,7 @@ public class SslContextFactory extends AbstractLifeCycle
|
|||
{
|
||||
String cn = list.get(1).toString();
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("Certificate san alias={} cn={} in {}",alias,cn,_factory);
|
||||
LOG.debug("Certificate san alias={} cn={} in {}",alias,cn,this);
|
||||
if (cn!=null)
|
||||
{
|
||||
named=true;
|
||||
|
@ -384,7 +366,7 @@ public class SslContextFactory extends AbstractLifeCycle
|
|||
{
|
||||
String cn = rdn.getValue().toString();
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("Certificate cn alias={} cn={} in {}",alias,cn,_factory);
|
||||
LOG.debug("Certificate cn alias={} cn={} in {}",alias,cn,this);
|
||||
if (cn!=null && cn.contains(".") && !cn.contains(" "))
|
||||
_certAliases.put(cn,alias);
|
||||
}
|
||||
|
@ -401,6 +383,26 @@ public class SslContextFactory extends AbstractLifeCycle
|
|||
_certWilds.put(name.substring(1),_certAliases.get(name));
|
||||
|
||||
LOG.info("x509={} for {}",_certAliases,this);
|
||||
|
||||
// Instantiate key and trust managers
|
||||
KeyManager[] keyManagers = getKeyManagers(keyStore);
|
||||
TrustManager[] trustManagers = getTrustManagers(trustStore,crls);
|
||||
|
||||
// Initialize context
|
||||
SecureRandom secureRandom = (_secureRandomAlgorithm == null)?null:SecureRandom.getInstance(_secureRandomAlgorithm);
|
||||
context = _sslProvider == null ? SSLContext.getInstance(_sslProtocol) : SSLContext.getInstance(_sslProtocol, _sslProvider);
|
||||
context.init(keyManagers,trustManagers,secureRandom);
|
||||
}
|
||||
}
|
||||
|
||||
_factory = new Factory(keyStore,trustStore,context);
|
||||
SSLEngine engine = newSSLEngine();
|
||||
if (LOG.isDebugEnabled())
|
||||
{
|
||||
LOG.debug("Enabled Protocols {} of {}",Arrays.asList(engine.getEnabledProtocols()),Arrays.asList(engine.getSupportedProtocols()));
|
||||
LOG.debug("Enabled Ciphers {} of {}",Arrays.asList(engine.getEnabledCipherSuites()),Arrays.asList(engine.getSupportedCipherSuites()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue