-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
TLSv1 and TLSv1.1 doesn't work #49210
Comments
That's the expected behavior (you also need minVersion) but it's possible the documentation could be clearer. I do believe it is documented in doc/api/tls.md, but maybe it's not very obvious or findable. Pull request welcome. |
@bnoordhuis Thank you for checking this. However, it doesn't work even if I add the minVersion: var execSync = require('child_process').execSync
var fs = require('fs')
var tls = require('tls')
var port = 8000
var minVersion = 'TLSv1'
var maxVersion = 'TLSv1' // works with TLSv1.2 and TLSv1.3, doesn't work with TLSv1 and TLSv1.1
execSync('openssl req -x509 -newkey rsa:1024 -keyout key -out cert -nodes -subj "/C=US/CN=localhost"')
var key = fs.readFileSync('key')
var cert = fs.readFileSync('cert')
tls.createServer({key, cert, minVersion, maxVersion}, function (socket) {
console.log('it works!', socket.getProtocol())
socket.end()
this.close()
}).
listen(port, () => {
tls.connect(8000, {ca: [cert]})
}) Failing with the same error:
|
I may be misremembering but you probably also need to pass |
@bnoordhuis It doesn't work with
Surprisingly, it does work on v16.20.2, without errors!
|
It's progress of a kind. Alert 70 is PROTOCOL_VERSION (i.e. protocol mismatch/unsupported), alert 80 is INTERNAL_ERROR, so basically a configuration error. Now that I think of it, you can probably drop the |
@bnoordhuis It works with |
Closing as this has been resolved and wasn't a node bug. No opinion on the pull request. |
Version
v18.17.0
Platform
Linux 5.15.0-1033-aws ~20.04.1-Ubuntu SMP Fri Mar 17 11:39:30 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
What steps will reproduce the bug?
Server created with TLSv1 refuses to connect:
How often does it reproduce? Is there a required condition?
Always fails
What is the expected behavior? Why is that the expected behavior?
Should support maxVersion: 'TLSv1' and 'TLSv1.1' as specified in the docs
https://nodejs.org/dist/latest-v18.x/docs/api/tls.html#tlscreatesecurecontextoptions
What do you see instead?
The text was updated successfully, but these errors were encountered: