Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify the documentation for TLS cipher configuration & defaults #41061

Closed
wants to merge 2 commits into from

Conversation

pimterry
Copy link
Member

@pimterry pimterry commented Dec 2, 2021

I needed to set ciphers on a TLS socket today, and the format of the cipher list string doesn't appear to be documented anywhere.

To work out how it worked, I needed to check the default value, which unfortunately also isn't documented.

This PR fixes both: making it clear that ciphers is a colon-separated list, and documenting the tls.DEFAULT_CIPHERS property that is its default value.

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. tls Issues and PRs related to the tls subsystem. labels Dec 2, 2021
@tniessen
Copy link
Member

tniessen commented Dec 3, 2021

@jasnell Is this an alias for crypto.constants.defaultCoreCipherList?

@jasnell
Copy link
Member

jasnell commented Dec 3, 2021

Yes and no. tls.DEFAULT_CIPHERS is set initially to equal crypto.constants.defaultCoreCipherList but is mutable once set, whereas crypto.constants.defaultCoreCipherList remains a constant.

@pimterry
Copy link
Member Author

pimterry commented Dec 3, 2021

tls.DEFAULT_CIPHERS also changes if you use --tls-cipher-list, unlike defaultCoreCipherList:

$ node --tls-cipher-list=aNULL
> require('crypto').constants.defaultCoreCipherList
'TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:DHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA256:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!SRP:!CAMELLIA'
> require('tls').DEFAULT_CIPHERS
'aNULL'

@pimterry
Copy link
Member Author

This was approved nearly a year ago and I think it's all good to go. I've just rebased and fixed conflicts, it'd be great to get this merged when somebody has a minute 🙏

@pimterry
Copy link
Member Author

Closing - a year and a half later #46482 added an equivalent change, and is now merged, so this is no longer necessary.

@pimterry pimterry closed this Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. tls Issues and PRs related to the tls subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants