Repository navigation
@SECLEVEL=X does not enable TLSv1 #60569
Description
Activity
- addeddocIssues and PRs related to Node.js documentation.Issues and PRs related to Node.js documentation.
on Nov 3, 2025 I was able to get the same error for v1. Yes, it does seem that with a lower maxVersion, there are no protocols to support since it doesn't automatically switch to lower one. Also, another thing to add, even if the maxVersion is set to v1.2, a 'sslv3 alert handshake failure', can still occur due to weaker ciphers or low security levels.
I will update the docs to add a note for this after the section.
Hello, I have added a commit updating the doc.
This is my first contribution, so please let me know if anything isn't done as expected and I would be happy to update.
This issue has been marked as stale due to 210 days of inactivity.
It will be automatically closed in 30 days if no further activity occurs. If this is still relevant, please leave a comment or update it to keep it open.- addedstaleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
on Jun 2, 2026 This issue is not stale, as in v26.3.0 it throws the same error and the docs were never changed.
- removedstaleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
on Jun 3, 2026 @davidebombelli Can you explain why lowering the seclevel should reduce the default TLS level? AFAICT the docs don't suggest anywhere that it does that, and there's plenty of reasons you might not expect this (e.g. lowering the seclevel to enable other now-deprecated OpenSSL features, but with TLS 1.2). We generally don't want to enable insecure configurations except in the most explicit circumstances when you very very clearly configure that.
Is there somewhere in our docs or the referenced OpenSSL docs that does say we do this, or imply something similar?
The max vs min issue discussed here and addressed in the PR is independent of the seclevel question, you can hit the same problem without changing the seclevel. I'm not opposed to documenting this, but honestly it's a bit of a footgun and we should probably just fix it instead of documenting the bad behaviour. I'd be open to a PR that made this fail explicitly with a clear validation error instead (failing immediately & clearly, instead of delaying the failure to handshake time, and throwing a confusing raw OpenSSL error when we get there). That would be semver-major since it could break some (very weird) code, so we'd have to defer releasing it until Node v27, but that's OK and it'd be a good improvement. PRs welcome.
Hello @pimterry, I did not come up with the code on my own, it is written in the documentation at the link I provided. And it is broken code.
I am not suggesting to changing the implementation of the API, but instead to change documentation.Ah, gotcha, I didn't realise that code was from there directly! That's much clearer thanks.
That just seems like a bug in the example. That code really should fail, so I think the behaviour itself is correct (although the error could be improved), but we should fix the docs to so this works as expected.
Want to open a quick docs PR? I think we just need to add
minVersion: 'TLSv1'to theconnect()call so it sets both min & max there.@pimterry the
minVersion: 'TLSv1'addition alone doesn't quite get there — it clears theno protocols availableerror, and then the handshake dies at alert 40, because the example'screateServeris given no key or cert, so the server has no shared cipher. PR with both is up: #65391 — theserver-key.pem/server-cert.pemplaceholders from the other tls.md examples, pluscaon the client and the sameopenssl reqrecipe those sections carry, so it runs from an empty directory. I also moved the port to the 8000 the rest of the file uses. Can trim any of it back.- added a commit that references this issue
on Aug 21, 2026 - added 3 commits that reference this issue
on Aug 25, 2026 - added 2 commits that reference this issue
on Sep 7, 2026
Affected URL(s)
https://nodejs.org/api/tls.html#setting-security-levels
Description of the problem
After running the below script:
I get the error:
It seems like
tls.DEFAULT_MIN_VERSIONis TLSv1.2. Maybe when setting a lowermaxVersion, this property is not automatically lowered.