tls: accept SecureContext object in server.addContext()#47570
Merged
nodejs-github-bot merged 1 commit intonodejs:mainfrom Apr 26, 2023
Merged
tls: accept SecureContext object in server.addContext()#47570nodejs-github-bot merged 1 commit intonodejs:mainfrom
nodejs-github-bot merged 1 commit intonodejs:mainfrom
Conversation
addaleax
approved these changes
Apr 15, 2023
anonrig
approved these changes
Apr 15, 2023
Collaborator
Contributor
Author
|
Failing test: It looks like a flaky test (doesn't seem to be related to the PR and tried running locally) |
lpinca
approved these changes
Apr 15, 2023
Do not call tls.createSecureContext() if the context provided is already an instance of tls.SecureContext. Fixes: nodejs#47408
939c576 to
9660674
Compare
jasnell
reviewed
Apr 17, 2023
| [re, tls.createSecureContext(context).context]); | ||
|
|
||
| const secureContext = | ||
| context instanceof common.SecureContext ? context : tls.createSecureContext(context); |
Member
There was a problem hiding this comment.
Might be worth implementing a more efficient isSecureContext(...) method under util/types
Contributor
Author
There was a problem hiding this comment.
I don't think this function is in hot path (there are limited number of subdomains & certs), so might not be worth the perf improvement vs code growth in primordials. Not too sure, CMIIW.
jasnell
approved these changes
Apr 17, 2023
Contributor
Author
|
BTW, I can't add the labels myself. So I can't add |
Collaborator
39 tasks
Collaborator
Collaborator
This was referenced Apr 25, 2023
Collaborator
|
Landed in b54504c |
This was referenced Apr 27, 2023
yjl9903
pushed a commit
to yjl9903/node
that referenced
this pull request
Apr 28, 2023
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>
yjl9903
pushed a commit
to yjl9903/node
that referenced
this pull request
Apr 28, 2023
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>
32 tasks
yjl9903
pushed a commit
to yjl9903/node
that referenced
this pull request
Apr 29, 2023
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>
targos
pushed a commit
that referenced
this pull request
May 2, 2023
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>
danielleadams
pushed a commit
that referenced
this pull request
Jul 6, 2023
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>
MoLow
pushed a commit
to MoLow/node
that referenced
this pull request
Jul 6, 2023
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>
Merged
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Do not call tls.createSecureContext() if the context provided is already an instance of tls.SecureContext.
Fixes: #47408