【问题标题】:Updating Fuse to have TLS v1.3更新 Fuse 以获得 TLS v1.3
【发布时间】:2021-03-17 05:06:51
【问题描述】:

我是 JBoss Fuse 服务器的新手。我们使用的 Fuse 服务器版本是 7.2。根据${karaf.home}/etc位置的undertow.xml文件,我们目前支持TLSv1TLSv1.1TLSv1.2。要求也添加更高版本(在本例中为TLSv1.3)。我想检查其先决条件和可行性方面。

另外,我无法确定 Fuse 7.2 是否支持TLSv1.3

我们使用的是 Java 8。

非常感谢任何可以引导我的信息/方向。

【问题讨论】:

    标签: java-8 jboss7.x jbossfuse tls1.3


    【解决方案1】:

    您可以查看安全指南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

    1. 取消注释 https-listener:
    <https-listener name="https" socket-binding="https"
        security-realm="https" verify-client="NOT_REQUESTED" />
    
    1. 确保密钥库的位置/凭据正确:
    <w:keystore path="${karaf.etc}/server.keystore" provider="JKS" alias="server"
        keystore-password="secret" key-password="secret"
    
    1. 确保信任库的位置/凭据正确(可以是同一个文件):
    <w:truststore path="${karaf.etc}/server.truststore" provider="JKS"
        keystore-password="secret" />
    
    1. 确保secure 接口未注释:
    <interface name="secure">
        <w:inet-address value="0.0.0.0" />
    </interface>
    
    1. 取消注释安全套接字绑定:
    <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, P-256, 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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-09-18
      • 1970-01-01
      • 2016-11-30
      • 1970-01-01
      • 1970-01-01
      • 2019-09-28
      相关资源
      最近更新 更多