【发布时间】:2016-09-01 20:04:16
【问题描述】:
我想在 Spring Boot 版本 1.4.0.RELEASE 中禁用 TLSv1.0。我们正在使用带有 spring boot 的嵌入式 jetty 版本 9.2.13.v20150730。
我认为弹簧靴属性不可能做到这一点。我已尝试关注,但 TLSv1 仍处于启用状态。
server.ssl.protocol TLS
server.ssl.enabled-protocols TLSv1.1,TLSv1.2
所以我检查了 spring boot 自动配置代码。下面是 Jetty 的 SSLContext 是如何被初始化的
以下 configureSsl 方法没有调用 factory.setExcludeProtocols 方法。即使 SslContextFactory 中有 setExcludeProtocols 方法。
能否请您在 spring boot 中添加 server.ssl.disabled-protocols 属性?或者如果这已经可以禁用 TLSv1.0,请告诉我。
/**
* Configure the SSL connection.
* @param factory the Jetty {@link SslContextFactory}.
* @param ssl the ssl details.
*/
protected void configureSsl(SslContextFactory factory, Ssl ssl) {
factory.setProtocol(ssl.getProtocol());
configureSslClientAuth(factory, ssl);
configureSslPasswords(factory, ssl);
factory.setCertAlias(ssl.getKeyAlias());
if (!ObjectUtils.isEmpty(ssl.getCiphers())) {
factory.setIncludeCipherSuites(ssl.getCiphers());
factory.setExcludeCipherSuites();
}
if (ssl.getEnabledProtocols() != null) {
factory.setIncludeProtocols(ssl.getEnabledProtocols());
}
if (getSslStoreProvider() != null) {
try {
factory.setKeyStore(getSslStoreProvider().getKeyStore());
factory.setTrustStore(getSslStoreProvider().getTrustStore());
}
catch (Exception ex) {
throw new IllegalStateException("Unable to set SSL store", ex);
}
}
else {
configureSslKeyStore(factory, ssl);
configureSslTrustStore(factory, ssl);
}
}
【问题讨论】:
标签: spring-boot