SSL握手与CentOS,curl和ECDHE

由于Logjam漏洞,我将密码局限于ECDHE,因此我无法再从Centos机器上进行curl。 (从Ubuntu的作品)

$ curl -v https://mysite.mydomain.com * Initializing NSS with certpath: sql:/etc/pki/nssdb * CAfile: /etc/pki/tls/certs/ca-bundle.crt CApath: none * NSS error -12286 (SSL_ERROR_NO_CYPHER_OVERLAP) * Cannot communicate securely with peer: no common encryption algorithm(s). 

用openssl作品打开:

 $ openssl s_client -connect mysite.mydomain.com:443 SSL-Session: Protocol : TLSv1.2 Cipher : ECDHE-RSA-AES256-GCM-SHA384 

我试着用明确的密码,–insecure和–tlsv1.2,没有运气

 $ curl --ciphers TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 -v https://mysite.mydomain.com curl: (59) Unknown cipher in list: TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 

编辑:尝试使用正确的NSS密码名称,小于384位:

 curl --ciphers ecdhe_rsa_aes_128_sha_256 https://mysite.mydomain.com * Connected to xxx (xxx) port 443 (#0) * Initializing NSS with certpath: sql:/etc/pki/nssdb * Unknown cipher in list: ecdhe_rsa_aes_128_sha_256 * Closing connection 0 curl: (59) Unknown cipher in list: ecdhe_rsa_aes_128_sha_256 

发现这个错误https://bugzilla.redhat.com/show_bug.cgi?id=1185708,但不帮我得到通过。

SSLLabs将这些密码报告为受支持:

 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (0xc030) ECDH 256 bits (eq. 3072 bits RSA) FS 256 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (0xc02f) ECDH 256 bits (eq. 3072 bits RSA) FS 128 TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 (0xc028) ECDH 256 bits (eq. 3072 bits RSA) FS 256 TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 (0xc027) ECDH 256 bits (eq. 3072 bits RSA) FS 128 TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA (0xc014) ECDH 256 bits (eq. 3072 bits RSA) FS 256 TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA (0xc013) ECDH 256 bits (eq. 3072 bits RSA) FS 128 

在NSS中,RHEL / CentOS默认不启用ECC。 你必须明确指定你想要的密码,例如

 curl --ciphers ecdhe_rsa_aes_128_gcm_sha_256 .... 

或者你的服务器支持的任何密码,并且还受到你的curl / NSS版本的支持。

有关更多详细信息,请参阅https://stackoverflow.com/a/31108631/3081018

我试着用明确的密码,–insecure和–tlsv1.2,没有运气

这个问题与证书validation无关,所以--insecure

curl – TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384

带有NSS和OpenSSL的密码名称是不同的,因为你在NSS后端使用curl,你必须使用NSS语法。 有关如何指定密码的信息,请参阅https://git.fedorahosted.org/cgit/mod_nss.git/plain/docs/mod_nss.html#Directives

此外,支持NSS的ECC只能从curl 7.36开始使用。