Apache-2.2

是否可以使用 mod_gnutls 和 Apache 2 配置 ECDHE-ECDSA?

  • October 27, 2014

我正在嘗試使用實現配置我的 Debian 盒子mod_gnutls(為了 SNI),以實現最佳結果TLSv1.0/1.1/1.2(忽略 SSL2 和 SSL3)

但是在我看來,如果可以使用ECDHE-ECDSA/ ECDHE-RSAin mod_gnutls,則無法使用gnutls-cli

+ECDHE-RSA:+ECDHE-ECDSAGnuTLSPriorities觸發錯誤Syntax error parsing priorities string at ...

我目前的配置行:

GnuTLSPriorities    NONE:+SHA512:+SHA384:+SHA256:+DHE-RSA:+DHE-PSK:
                   +DHE-DSS:+AES-256-CBC:+AES-128-CBC:+3DES-CBC:+VERS-TLS1.2:
                   +VERS-TLS1.1:+VERS-TLS1.0:+COMP-NULL:+SHA1:+SIGN-ALL

哪裡的輸出nmap

> nmap --script ssl-enum-ciphers -p 443 www.mydomain.tld

Starting Nmap 6.47 ( http://nmap.org ) at 2014-10-27 00:55 CET
Nmap scan report for www.mydomain.tld (46.249.37.143)
Host is up (0.046s latency).
rDNS record for 46.249.37.143: lampicka.cz
PORT    STATE SERVICE
443/tcp open  https
| ssl-enum-ciphers: 
|   TLSv1.0: 
|     ciphers: 
|       TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA - strong
|       TLS_DHE_RSA_WITH_AES_128_CBC_SHA - strong
|       TLS_DHE_RSA_WITH_AES_256_CBC_SHA - strong
|     compressors: 
|       NULL
|   TLSv1.1: 
|     ciphers: 
|       TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA - strong
|       TLS_DHE_RSA_WITH_AES_128_CBC_SHA - strong
|       TLS_DHE_RSA_WITH_AES_256_CBC_SHA - strong
|     compressors: 
|       NULL
|   TLSv1.2: 
|     ciphers: 
|       TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA - strong
|       TLS_DHE_RSA_WITH_AES_128_CBC_SHA - strong
|       TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 - strong
|       TLS_DHE_RSA_WITH_AES_256_CBC_SHA - strong
|       TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 - strong
|     compressors: 
|       NULL

gnutls-cli, 當給定附加配置時的輸出+ECDHE-RSA:+ECDHE-ECDSA

> gnutls-cli -l --priority "NONE:+SHA512:+SHA384:+SHA256:+DHE-RSA:+DHE-PSK:+DHE-DSS:+AES-256-CBC:+AES-128-CBC:+3DES-CBC:+VERS-TLS1.2:+VERS-TLS1.1:+VERS-TLS1.0:+COMP-NULL:+SHA1:+SIGN-ALL:+ECDHE-RSA:+ECDHE-ECDSA"
Cipher suites for NONE:+SHA512:+SHA384:+SHA256:+DHE-RSA:+DHE-PSK:+DHE-DSS:+AES-256-CBC:+AES-128-CBC:+3DES-CBC:+VERS-TLS1.2:+VERS-TLS1.1:+VERS-TLS1.0:+COMP-NULL:+SHA1:+SIGN-ALL:+ECDHE-RSA:+ECDHE-ECDSA
TLS_DHE_RSA_AES_256_CBC_SHA256                          0x00, 0x6b      TLS1.0
TLS_DHE_RSA_AES_256_CBC_SHA1                            0x00, 0x39      SSL3.0
TLS_DHE_RSA_AES_128_CBC_SHA256                          0x00, 0x67      TLS1.0
TLS_DHE_RSA_AES_128_CBC_SHA1                            0x00, 0x33      SSL3.0
TLS_DHE_RSA_3DES_EDE_CBC_SHA1                           0x00, 0x16      SSL3.0
TLS_DHE_PSK_AES_256_CBC_SHA384                          0x00, 0xb3      TLS1.0
TLS_DHE_PSK_AES_256_CBC_SHA1                            0x00, 0x91      SSL3.0
TLS_DHE_PSK_AES_128_CBC_SHA256                          0x00, 0xb2      TLS1.0
TLS_DHE_PSK_AES_128_CBC_SHA1                            0x00, 0x90      SSL3.0
TLS_DHE_PSK_3DES_EDE_CBC_SHA1                           0x00, 0x8f      SSL3.0
TLS_DHE_DSS_AES_256_CBC_SHA256                          0x00, 0x6a      TLS1.0
TLS_DHE_DSS_AES_256_CBC_SHA1                            0x00, 0x38      SSL3.0
TLS_DHE_DSS_AES_128_CBC_SHA256                          0x00, 0x40      TLS1.0
TLS_DHE_DSS_AES_128_CBC_SHA1                            0x00, 0x32      SSL3.0
TLS_DHE_DSS_3DES_EDE_CBC_SHA1                           0x00, 0x13      SSL3.0
TLS_ECDHE_RSA_AES_256_CBC_SHA384                        0xc0, 0x28      TLS1.0
TLS_ECDHE_RSA_AES_256_CBC_SHA1                          0xc0, 0x14      SSL3.0
TLS_ECDHE_RSA_AES_128_CBC_SHA256                        0xc0, 0x27      TLS1.0
TLS_ECDHE_RSA_AES_128_CBC_SHA1                          0xc0, 0x13      SSL3.0
TLS_ECDHE_RSA_3DES_EDE_CBC_SHA1                         0xc0, 0x12      SSL3.0
TLS_ECDHE_ECDSA_AES_256_CBC_SHA384                      0xc0, 0x24      TLS1.0
TLS_ECDHE_ECDSA_AES_256_CBC_SHA1                        0xc0, 0x0a      SSL3.0
TLS_ECDHE_ECDSA_AES_128_CBC_SHA256                      0xc0, 0x23      TLS1.0
TLS_ECDHE_ECDSA_AES_128_CBC_SHA1                        0xc0, 0x09      SSL3.0
TLS_ECDHE_ECDSA_3DES_EDE_CBC_SHA1                       0xc0, 0x08      SSL3.0

Certificate types: none
Protocols: VERS-TLS1.2, VERS-TLS1.1, VERS-TLS1.0
Compression: COMP-NULL
Elliptic curves: none
PK-signatures: SIGN-RSA-SHA256, SIGN-DSA-SHA256, SIGN-ECDSA-SHA256, SIGN-RSA-SHA384, SIGN-ECDSA-SHA384, SIGN-RSA-SHA512, SIGN-ECDSA-SHA512, SIGN-RSA-SHA224, SIGN-DSA-SHA224, SIGN-ECDSA-SHA224, SIGN-RSA-SHA1, SIGN-DSA-SHA1, SIGN-ECDSA-SHA1

我的軟體版本是:

  • libapache2-mod-gnutls

    • 0.5.10-1.1
  • 阿帕奇2

    • 2.2.22-13+deb7u3
  • gnutls-bin

    • 3.3.8-3

好吧,事實證明問題出在libapache2-mod-gnutls版本上。

版本0.5.X與 連結libgnutls26,其中不包含那些密碼與

版本0.6.X連結libgnutls28,其中包含 ECDHE-RSA/ECDHE-ECDSA

所以解決方案有兩種:

  • 升級到較新版本的 libapache2-mod-gnutls,這需要Apache 2.4
  • 使用 Apache 2.2 版本中包含的 OpenSSL,並進行適當的配置

libapache2-mod-gnutls 的有效配置是:

GnuTLSPriorities    NONE:+SHA512:+SHA384:+SHA256:+ECDHE-RSA:+ECDHE-ECDSA:+DHE-RSA:+DHE-PSK:
                   +DHE-DSS:+AES-256-CBC:+AES-128-CBC:+3DES-CBC:+VERS-TLS1.2:
                   +VERS-TLS1.1:+VERS-TLS1.0:+COMP-NULL:+SHA1:+SIGN-ALL

apache2(openssl)的有效配置是:

SSLCipherSuite ECDHE-ECDSA-AES256-SHA:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:RC4-RSA:HIGH:!MD5:!aNULL
SSLHonorCipherOrder     on
SSLCompression          off
SSLProtocol all -SSLv2 -SSLv3
Header add Strict-Transport-Security "max-age=15768000"

引用自:https://serverfault.com/questions/639825