-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
tls.SecureContext documentation contradictions #47408
Comments
Pull request welcome. You can check inside addContext() if the context argument is already instanceof SecureContext and then use Lines 1479 to 1480 in 6fd147c
|
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. |
Do not call tls.createSecureContext() if the context provided is already an instance of tls.SecureContext. Fixes: nodejs#47408
Do not call tls.createSecureContext() if the context provided is already an instance of tls.SecureContext. Fixes: nodejs#47408
Do not call tls.createSecureContext() if the context provided is already an instance of tls.SecureContext. Fixes: #47408 PR-URL: #47570 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Do not call tls.createSecureContext() if the context provided is already an instance of tls.SecureContext. Fixes: nodejs#47408 PR-URL: nodejs#47570 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Do not call tls.createSecureContext() if the context provided is already an instance of tls.SecureContext. Fixes: nodejs#47408 PR-URL: nodejs#47570 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Do not call tls.createSecureContext() if the context provided is already an instance of tls.SecureContext. Fixes: nodejs#47408 PR-URL: nodejs#47570 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Do not call tls.createSecureContext() if the context provided is already an instance of tls.SecureContext. Fixes: #47408 PR-URL: #47570 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Do not call tls.createSecureContext() if the context provided is already an instance of tls.SecureContext. Fixes: #47408 PR-URL: #47570 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Do not call tls.createSecureContext() if the context provided is already an instance of tls.SecureContext. Fixes: nodejs#47408 PR-URL: nodejs#47570 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
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 aSecureContext
object as an argument. However, according to the documention of server.addContext(), the only valid argument foroptions
isSecureContextOptions
, but not theSecureContext
object itself.I have tried passing a
SecureContext
object 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 aSecureContext
object. Ideally, you should fix the code and update the documentation forserver.addContext()
.Thank you.
The text was updated successfully, but these errors were encountered: