Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

honorCipherOrder should be supported for SNI TLS/SSL connections #7249

Closed
Rush opened this issue Mar 5, 2014 · 8 comments
Closed

honorCipherOrder should be supported for SNI TLS/SSL connections #7249

Rush opened this issue Mar 5, 2014 · 8 comments
Assignees
Milestone

Comments

@Rush
Copy link

Rush commented Mar 5, 2014

Test is here:
https://gist.github.com/RushPL/9376770
Below test for primary domain is correct:

> openssl s_client -servername test1.com -connect localhost:4000 2> /dev/null|grep Cipher
New, TLSv1/SSLv3, Cipher is ECDHE-RSA-AES256-GCM-SHA384
    Cipher    : ECDHE-RSA-AES256-GCM-SHA384

Below test for secondary (SNI resolved) domain is not correct as the cipher should be the same as in the above test:

> openssl s_client -servername test2.com -connect localhost:4000 2> /dev/null|grep Cipher
New, TLSv1/SSLv3, Cipher is RC4-SHA
    Cipher    : RC4-SHA

Forcing server's cipher order is necessary to implement forwarding secrecy https://community.qualys.com/blogs/securitylabs/2013/06/25/ssl-labs-deploying-forward-secrecy

This forbids NSA or other third parties to listen on connections even if the private keys are compromised. Special key exchange happens on negotiation.

I have tried to workaround lack of honorCipherOrder option by manually passing the constant to the Credentials constructor but it fails for some reason. Please advise.

@indutny
Copy link
Member

indutny commented Mar 5, 2014

Indeed, this is a bug. Confirming.

@indutny indutny added this to the v0.12 milestone Mar 5, 2014
@indutny indutny self-assigned this Mar 5, 2014
indutny added a commit to indutny/node that referenced this issue Mar 6, 2014
Add `honorCipherOrder` argument to `crypto.createCredentials`.

fix nodejs#7249
@indutny
Copy link
Member

indutny commented Mar 6, 2014

Not exactly what I was initially think about, but anyway a fix: #7255

@Rush
Copy link
Author

Rush commented Mar 6, 2014

Does it really fix it? It does not for me. In my gist I tried to do secureOptions: require('constants').SSL_OP_CIPHER_SERVER_PREFERENCE but it did not affect the behaviour even before your fix.

@indutny
Copy link
Member

indutny commented Mar 6, 2014

You forgot to add ecdhCurve: tls.DEFAULT_ECDH_CURVE to it, without it credentials won't be used for EC* ciphers.

@indutny
Copy link
Member

indutny commented Mar 6, 2014

Anyway, I think that my PR has some value. I'm open for discussion of setting ecdhCurve by default in node v0.11-v0.12.

@Rush
Copy link
Author

Rush commented Mar 6, 2014

I do not have any opinion on setting ecdhCurve. My only point is that behavior should be consistent between options passed to tls.createServer and options passed to crypto.createCredentials. If ecdhCurve must be explicit it should be explicit in both cases.

@indutny
Copy link
Member

indutny commented Mar 6, 2014

I agree with you, but it could be used for different purposes and it is a public method, I'm afraid we can't change it's behavior in v0.10 . I'll open a PR for v0.11 shortly.

indutny added a commit to indutny/node that referenced this issue Mar 6, 2014
Move `DEFAULT_CIPHERS` and `DEFAULT_ECDH_CURVE` from `tls` module into
the `crypto` module. Make `crypto.createCredentials` use default values.

fix nodejs#7249
@indutny
Copy link
Member

indutny commented Mar 6, 2014

Proposed changes are in #7265

indutny added a commit that referenced this issue Jun 25, 2014
Add `honorCipherOrder` argument to `crypto.createCredentials`.

fix #7249
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants