Tomcat7使用APR Connector启用tlsv1.1

时间:2014-06-25 00:31:53

标签: java tomcat ssl

这是我的环境: Ubuntu 12.04 Sun JRE 1.7.0_60 Tomcat 7.0.26 Openssl 1.0.1-4ubuntu5.15 libssl1.0.0 1.0.1-4ubuntu5.15

目前,我的tomcat服务器接受 TLSv1 连接,我正在尝试更新配置以支持 TLSv1.1 连接。以下是我当前的Connector配置是server.xml

<Connector port="443" protocol="HTTP/1.1" SSLEnabled="true"
               maxThreads="150" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLSv1" acceptCount="100"
               disableUploadTimeout="true" enableLookups="false"
               SSLCertificateFile="/opt/certs/cert.pem"
               SSLCertificateKeyFile="/opt/certs/private-key.pem"
               SSLCACertificateFile="/opt/certs/cert.pem"
               server="Apache"
               ciphers="TLS_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_256_CBC_SHA" />

我尝试将TLSv1更改为TLSv1.1但似乎没有解决问题。 这是运行follwing命令

的输出
openssl s_client -connect ip_address:443 -tls1_1 -msg

CONNECTED(00000003)
>>> TLS 1.1  [length 00dc]
    01 00 00 d8 03 02 53 aa 16 c1 84 4a 2d a1 8b 54
    e9 10 85 dd 30 66 c6 d8 41 0c 57 38 fa 59 95 6c
    82 e7 dc 6f ac bb 00 00 66 c0 14 c0 0a c0 22 c0
    21 00 39 00 38 00 88 00 87 c0 0f c0 05 00 35 00
    84 c0 12 c0 08 c0 1c c0 1b 00 16 00 13 c0 0d c0
    03 00 0a c0 13 c0 09 c0 1f c0 1e 00 33 00 32 00
    9a 00 99 00 45 00 44 c0 0e c0 04 00 2f 00 96 00
    41 c0 11 c0 07 c0 0c c0 02 00 05 00 04 00 15 00
    12 00 09 00 14 00 11 00 08 00 06 00 03 00 ff 01
    00 00 49 00 0b 00 04 03 00 01 02 00 0a 00 34 00
    32 00 0e 00 0d 00 19 00 0b 00 0c 00 18 00 09 00
    0a 00 16 00 17 00 08 00 06 00 07 00 14 00 15 00
    04 00 05 00 12 00 13 00 01 00 02 00 03 00 0f 00
    10 00 11 00 23 00 00 00 0f 00 01 01
>>> TLS 1.0 Alert [length 0002], fatal protocol_version
    02 46
139739825112736:error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number:s3_pkt.c:337:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 5 bytes and written 7 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
SSL-Session:
    Protocol  : TLSv1.1
    Cipher    : 0000
    Session-ID:
    Session-ID-ctx:
    Master-Key:
    Key-Arg   : None
    PSK identity: None
    PSK identity hint: None
    SRP username: None
    Start Time: 1403655873
    Timeout   : 7200 (sec)
    Verify return code: 0 (ok)
---

即使我已将sslProtocols更改为TLSv1.1,TLSv1连接仍然有效。我已经浏览过tomcat文档,并且在 APR 连接器中没有提及有关TLSv1.1的任何内容,是否可以这样做或者我必须使用其他连接器?

1 个答案:

答案 0 :(得分:1)

根据tomcat apr ssl page,您可能还需要将sslEnabledProtocols值填充到TLSv1.1