如何解决更新 Fuse 以使用 TLS v1.3
我是 JBoss Fuse 服务器的新手。我们使用的 Fuse 服务器版本是 7.2。根据 undertow.xml
位置的 ${karaf.home}/etc
文件,我们目前支持 TLSv1
、TLSv1.1
和 TLSv1.2
。要求也添加更高版本(本例中为TLSv1.3
)。我想检查先决条件和可行性方面。
此外,我无法确定 Fuse 7.2 是否支持 TLSv1.3
。
我们使用的是 Java 8。
非常感谢任何可以引导我的信息/方向。
解决方法
您可以查看安全指南at this location。
首先,您必须启用安全侦听器。您在两个文件中执行此操作:
etc/org.ops4j.pax.web.cfg
,您需要两个新属性(根据 OSGi CMPN Http Service specification):
org.osgi.service.http.port.secure = 8443
org.osgi.service.http.secure.enabled = true
您当然需要一个密钥库/信任库(可以相同或分开)。例如将其复制到 etc/server.keystore
。
最后,您需要更改 etc/undertow.xml
。
- 取消注释 https-listener:
<https-listener name="https" socket-binding="https"
security-realm="https" verify-client="NOT_REQUESTED" />
- 确保密钥库的位置/凭据正确:
<w:keystore path="${karaf.etc}/server.keystore" provider="JKS" alias="server"
keystore-password="secret" key-password="secret"
- 确保信任库的正确位置/凭据(可能是同一个文件):
<w:truststore path="${karaf.etc}/server.truststore" provider="JKS"
keystore-password="secret" />
- 确保
secure
接口未注释:
<interface name="secure">
<w:inet-address value="0.0.0.0" />
</interface>
- 取消注释安全套接字绑定:
<socket-binding name="https" interface="secure"
port="${org.osgi.service.http.port.secure}" />
现在,当您重新启动 Fuse 7.2 时,您将在 8443 端口拥有安全侦听器。
但是还有一件事。 Undertow TLS 引擎配置是(默认情况下):
<w:engine
enabled-cipher-suites="TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384"
enabled-protocols="TLSv1 TLSv1.1 TLSv1.2" />
然而,TLS_ECDHE_* 套件对于 TLS 1.2 来说是强大的,并且某些客户端(浏览器)不一定支持(组合)。您已经可以使用例如以下方式连接到此类 Fuse 实例:
$ openssl s_client -connect 127.0.0.1:8443 -debug -tls1_2 -ciphersuites TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
CONNECTED(00000003)
...
Server Temp Key: ECDH,P-256,256 bits
---
SSL handshake has read 1691 bytes and written 386 bytes
Verification error: unable to verify the first certificate
---
New,TLSv1.2,Cipher is ECDHE-RSA-AES256-SHA384
Server public key is 2048 bit
...
您现在不能使用 TLS 1.3:
$ openssl s_client -connect 127.0.0.1:8443 -tls1_3 -debug
CONNECTED(00000003)
write to 0x562ac4785740 [0x562ac479cb90] (215 bytes => 215 (0xD7))
0000 - 16 03 01 00 d2 01 00 00-ce 03 03 12 4c a3 cb de ............L...
0010 - 46 95 45 07 5b 86 05 d0-69 20 3c e2 70 9f 0f 99 F.E.[...i <.p...
...
New,(NONE),Cipher is (NONE)
...
首先,您必须更改引擎中启用的协议 (etc/undertow.xml
):
enabled-protocols="TLSv1.3"
但是如果您添加(到 etc/system.properties
):
javax.net.debug=all
你会看到类似的东西:
javax.net.ssl|FINE|6F|XNIO-4 I/O-8|2021-03-17 07:46:46.011 CET|Logger.java:765|Ignore unsupported cipher suite: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 for TLS13
javax.net.ssl|FINE|6F|XNIO-4 I/O-8|2021-03-17 07:46:46.011 CET|Logger.java:765|Ignore unsupported cipher suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 for TLS13
所以看起来剩下的事情是为 TLS 1.3 找到合适的密码套件。其中一个套件是 TLS_AES_256_GCM_SHA384
,因此如果您使用:
enabled-cipher-suites="TLS_AES_256_GCM_SHA384"
您将成功连接 - 使用浏览器和 openssl:
$ openssl s_client -connect 127.0.0.1:8443 -tls1_3 -ciphersuites TLS_AES_256_GCM_SHA384
CONNECTED(00000003)
...
Peer signing digest: SHA256
Peer signature type: RSA-PSS
Server Temp Key: ECDH,256 bits
---
SSL handshake has read 1906 bytes and written 640 bytes
Verification error: unable to verify the first certificate
---
New,TLSv1.3,Cipher is TLS_AES_256_GCM_SHA384
Server public key is 2048 bit
...
Post-Handshake New Session Ticket arrived:
SSL-Session:
Protocol : TLSv1.3
Cipher : TLS_AES_256_GCM_SHA384
...
还有一件事。您必须使用支持 TLS 1.3 的 JDK 8,即:
- 至少是 Oracle JDK 1.8.0_261
- 至少是 OpenJDK 8u272
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。