FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

https: reuse TLS sessions in Agent by indutny · Pull Request #2228 · nodejs/node · GitHub

/ node Public

https: reuse TLS sessions in Agent - #2228

Closed
indutny wants to merge 1 commit into
nodejs:masterfrom
indutny:fix/gh-1499
Closed

https: reuse TLS sessions in Agent#2228
indutny wants to merge 1 commit into
nodejs:masterfrom
indutny:fix/gh-1499

Conversation

indutny commented Jul 23, 2015

Copy link
Copy Markdown
Member

Fix: #1499

indutny commented Jul 23, 2015

Copy link
Copy Markdown
Member Author

cc @nodejs/crypto @nodejs/collaborators

brendanashworth added tls Issues and PRs related to the tls subsystem. https Issues or PRs related to the https subsystem. labels Jul 23, 2015
Comment thread lib/https.js Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

If session is the only one being set, maybe it is worth it to just use options.session = options.session || ...?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Yeah, but we usually try to avoid changing the objects that are passed to the function.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think we already make a copy, that's why I'm asking. :) Not trying to be a stickler - you could say that call and I go back a little bit.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Haha, I'd leave it as it is. Performance impact is minimal here.

Copy link
Copy Markdown
Contributor

Can this cause a memory leak for servers that make a lot of TLS connections to different servers?

indutny commented Jul 23, 2015

Copy link
Copy Markdown
Member Author

@brendanashworth good catch! I'll revise it tomorrow

indutny commented Jul 23, 2015

Copy link
Copy Markdown
Member Author

@brendanashworth added limit ;)

indutny commented Jul 23, 2015

Copy link
Copy Markdown
Member Author

Any further comments @brendanashworth ? cc @bnoordhuis @shigeki ;)

Copy link
Copy Markdown
Contributor

@indutny 'tis cool and a great improvement on before :) but I'm not comfortable reviewing, too complicated - no further comments. Can't wait to see this merged!

Comment thread lib/_tls_wrap.js Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

FWIW Buffer.compare() is still fairly slow right now and using a manual for-loop in js land is faster.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Isn't there an edge case if socket.getSession() returns null?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Good point, @shigeki !

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

After some consideration - I don't think that it might be the case at this point in runtime. But I will add guard just in case.

shigeki commented Jul 24, 2015

Copy link
Copy Markdown
Contributor

I made several tests with/without resumption against my https server and confirmed this works fine. Good job. I put small comments for fix but LGTM.
It's not an issue but I found that TLSSocket.getPeerCertificate() returns an empty object because a server does not sent Certificate to a client in resumption. It is caused by protocol spec itself but we have to care what information is lost in resumption.

indutny commented Jul 24, 2015

Copy link
Copy Markdown
Member Author

Thanks everyone! May I ask you to take one last look at this before I'll land it?

indutny commented Jul 24, 2015

Copy link
Copy Markdown
Member Author

Comment thread lib/_tls_wrap.js Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

don't care if you make this change, but could use return session.equals(next); (assuming they're both buffers).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Good point. I'll use next.equals() here.

Fix: nodejs#1499
PR-URL: nodejs#2228
Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>

indutny commented Jul 27, 2015

Copy link
Copy Markdown
Member Author

@trevnorris fixed

Copy link
Copy Markdown
Contributor

LGTM

indutny added a commit that referenced this pull request Jul 27, 2015
Fix: #1499
PR-URL: #2228
Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>

indutny commented Jul 27, 2015

Copy link
Copy Markdown
Member Author

Landed in 2ca5a3d, thank you everyone!

indutny closed this Jul 27, 2015
indutny deleted the fix/gh-1499 branch July 27, 2015 18:48
nicolas-moteau added a commit to Orange-OpenSource/node that referenced this pull request Mar 6, 2019
BridgeAR pushed a commit to BridgeAR/node that referenced this pull request Mar 6, 2019
PR-URL: nodejs#26433
Refs: nodejs#2228
Refs: nodejs#4252
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
BridgeAR pushed a commit to BridgeAR/node that referenced this pull request Mar 12, 2019
PR-URL: nodejs#26433
Refs: nodejs#2228
Refs: nodejs#4252
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
BridgeAR pushed a commit that referenced this pull request Mar 14, 2019
PR-URL: #26433
Refs: #2228
Refs: #4252
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
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

Labels

https Issues or PRs related to the https subsystem. tls Issues and PRs related to the tls subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants


Back | FazBrowse Home | New Git URL