doc: add note to tls docs about secureContext availability

tls.createServer() and new tls.Server() ignore secureContext option.

PR-URL: https://github.com/nodejs/node/pull/46224
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
Tim Gerk
2023-01-17 17:53:41 -08:00
committed by GitHub
parent 5a7d4a774d
commit 6ecbd57f59

View File

@@ -1940,8 +1940,9 @@ from `process.argv` as the default value of the `sessionIdContext` option, other
APIs that create secure contexts have no default value.
The `tls.createSecureContext()` method creates a `SecureContext` object. It is
usable as an argument to several `tls` APIs, such as [`tls.createServer()`][]
and [`server.addContext()`][], but has no public methods.
usable as an argument to several `tls` APIs, such as [`server.addContext()`][],
but has no public methods. The [`tls.Server`][] constructor and the
[`tls.createServer()`][] method do not support the `secureContext` option.
A key is _required_ for ciphers that use certificates. Either `key` or
`pfx` can be used to provide it.