Repository navigation
tls.SecureContext documentation contradictions #47408
Copy link
Copy link
Closed
Labels
feature requestIssues requesting new Node.js features.Issues requesting new Node.js features.tlsIssues and PRs related to the tls subsystem.Issues and PRs related to the tls subsystem.
Description
Activity
- addeddocIssues and PRs related to Node.js documentation.Issues and PRs related to Node.js documentation.
on Apr 4, 2023 Pull request welcome. You can check inside addContext() if the context argument is already instanceof SecureContext and then use
context.contextinstead of passingcontexttotls.createSecureContext():
Lines 1479 to 1480 in 6fd147c
ArrayPrototypePush(this._contexts, [re, tls.createSecureContext(context).context]); Reacted by HinataKah0- addedtlsIssues and PRs related to the tls subsystem.Issues and PRs related to the tls subsystem.feature requestIssues requesting new Node.js features.Issues requesting new Node.js features.and removeddocIssues and PRs related to Node.js documentation.Issues and PRs related to Node.js documentation.
on Apr 4, 2023 Seems like a relatively simple change. Unfortunately, I don't have an environment where I can readily build and test node.js.
If you want to try, you can refer to this for building Node JS locally.
- added a commit that references this issue
on Apr 26, 2023 - added a commit that references this issue
on May 2, 2023 - added a commit that references this issue
on Jul 6, 2023 - added a commit that references this issue
on Jul 6, 2023
Metadata
Metadata
Assignees
Labels
feature requestIssues requesting new Node.js features.Issues requesting new Node.js features.tlsIssues and PRs related to the tls subsystem.Issues and PRs related to the tls subsystem.
Affected URL(s)
https://nodejs.org/api/tls.html#tlscreatesecurecontextoptions
https://nodejs.org/api/tls.html#serveraddcontexthostname-context
Description of the problem
The documentation for tls.createSecureContext() states:
So according to the documentation,
server.addContext()should take aSecureContextobject as an argument. However, according to the documention of server.addContext(), the only valid argument foroptionsisSecureContextOptions, but not theSecureContextobject itself.I have tried passing a
SecureContextobject toserver.addContext(). While it did not throw any errors, it did not configure the secure context properly.It would really be nice if
server.addContext()would take aSecureContextobject. Ideally, you should fix the code and update the documentation forserver.addContext().Thank you.