英文:
SpringBoot MVC - Warning: org.apache.tomcat.util.net.SSLUtilBase : The JSSE TLS 1.3 implementation does not support authentication
问题
关于使用Tomcat和TLSv1.3的Spring Boot MVC问题
我曾经有一个基于Tomcat的Spring Boot MVC网络应用,具有非常简单的业务逻辑,通过ssl HTTPS进行通信。
根据安全团队的审查,我不得不将TLS版本从TLSv1.2升级到TLSv1.3。
我认为这很简单,可以轻松完成这个任务,于是我去更改了我的属性:
server.ssl.enabled-protocols=TLSv1.2
改为
server.ssl.enabled-protocols=TLSv1.3
然而,自那以后,每次应用程序启动时我都会得到以下信息:
org.apache.tomcat.util.net.SSLUtilBase : JSSE TLS 1.3实现不支持在初始握手之后进行身份验证,因此与可选的客户端身份验证不兼容
这是什么意思?
这是否“危险”?
请问如何修复?
谢谢
英文:
A question about Spring Boot MVC with Tomcat and TLSv1.3
I used to have a Spring Boot MVC, Tomcat based web app, with very simple business logic, over ssl HTTPS.
Per security team review, I had to bump the TLS version from TLSv1.2 to TLSv1.3.
Thought is was very simple and could easily complete this task, I went to change my property:
server.ssl.enabled-protocols=TLSv1.2
to
server.ssl.enabled-protocols=TLSv1.3
However, since then, I am getting this on each application start up:
org.apache.tomcat.util.net.SSLUtilBase : The JSSE TLS 1.3 implementation does not support authentication after the initial handshake and is therefore incompatible with optional client authentication
What does it mean please?
Is it "dangerous"?
How to fix it please?
Thank you
答案1
得分: 11
Post-Handshake Client Authentication 是 TLSv1.3 扩展,定义在 RFC8446 中。但是 OpenJDK 不实现它,也不会实现它。相应的问题标记为“不会修复”。
这个警告是由 Tomcat 在 SSLUtilBase.java 中发出的。
if (enabledProtocols.contains(Constants.SSL_PROTO_TLSv1_3) &&
sslHostConfig.getCertificateVerification() == CertificateVerification.OPTIONAL &&
!isTls13RenegAuthAvailable() && warnTls13) {
log.warn(sm.getString("sslUtilBase.tls13.auth"));
}
isTls13RenegAuthAvailable()
方法在 JSSEUtil.java 中定义。
@Override
protected boolean isTls13RenegAuthAvailable() {
// TLS 1.3 不支持初始握手后的身份验证
return false;
}
要消除这个警告,你可以将 Tomcat 的 SSLHostConfig 中的 CertificateVerification 设置为 NONE
或 REQUIRED
。你可以通过 Spring Boot 属性 server.ssl.client-auth 来设置它,可以取值 NONE
、WANT
和 NEED
。
如果你不使用客户端证书,将其设置为 NONE
。如果你使用客户端证书,请检查每个客户端是否能够正确地使用 NEED
值进行身份验证。如果保持不变,唯一的风险是使用后握手认证的客户端将无法进行身份验证。
如果你真的需要后握手客户端身份验证,你将不得不使用比 JSSE 更多的 TLS 实现。你可以使用反向代理,如 Apache、NGINX、Traefik,或者使用 Tomcat 的本地 绑定用于 APR/OpenSSL。这里有一篇你可以阅读的有趣文章:Tomcat Native / OpenSSL in Spring Boot 2.0
== 2023年4月5日更新 ==
在 OpenJDK security-dev 邮件列表上的一条 消息 后,OpenJDK 问题 被重新打开,"Won't fix" 标签被移除。但是 TLS 1.3 后握手认证仍然没有在 OpenJDK 中实现。
英文:
Post-Handshake Client Authentication is a TLSv1.3 extension defined in RFC8446. But OpenJDK doesn't implement it and will not implement it. The corresponding issue is marked as "Won't fix".
The warning is emitted by Tomcat in SSLUtilBase.java
if (enabledProtocols.contains(Constants.SSL_PROTO_TLSv1_3) &&
sslHostConfig.getCertificateVerification() == CertificateVerification.OPTIONAL &&
!isTls13RenegAuthAvailable() && warnTls13) {
log.warn(sm.getString("sslUtilBase.tls13.auth"));
}
The isTls13RenegAuthAvailable()
method is defined in JSSEUtil.java
@Override
protected boolean isTls13RenegAuthAvailable() {
// TLS 1.3 does not support authentication after the initial handshake
return false;
}
To remove this warning you can either set CertificateVerification in Tomcat's SSLHostConfig to NONE
or to REQUIRED
. You can do it through the Spring Boot property server.ssl.client-auth which take the values NONE
, WANT
and NEED
.
If you don't use client certificates, set it to NONE
. If you use client certificates, check that each client can authenticate itself correctly with the NEED
value. If you leave it as it, the only risk is that client that use post-handshake authentication will not be able to authenticate.
If you really need post-handshake client authentication, you will have to use another TLS implementation than JSSE. You can either use a reverse proxy such as Apache, NGINX, Traefik or use Tomcat’s native bindings for APR/OpenSSL. There is an interesting article you can read about this: Tomcat Native / OpenSSL in Spring Boot 2.0
== Update 5th April 2023 ==
After a message on the OpenJDK security-dev mailing list, the OpenJDK issue has been reopened and the "Won't fix" label has been removed. But the TLS 1.3 Post-handshake authentication is still not implemented in the OpenJDK.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论