Skip to content

Conversation

@pimterry
Copy link
Member

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-botnodejs-github-bot added doc Issues and PRs related to the documentations. tls Issues and PRs related to the tls subsystem. labels Dec 2, 2021
@pimterrypimterryforce-pushed the clarify-tls-cipher-docs branch from 3aa7277 to 286012aCompareDecember 2, 2021 16:25
@tniessen
Copy link
Member

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

@jasnell
Copy link
Member

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
MemberAuthor

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' 

@pimterrypimterryforce-pushed the clarify-tls-cipher-docs branch from 286012a to 0b583f8CompareOctober 26, 2022 13:21
@pimterry
Copy link
MemberAuthor

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
MemberAuthor

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

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docIssues and PRs related to the documentations.tlsIssues and PRs related to the tls subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@pimterry@tniessen@jasnell@lpinca@nodejs-github-bot