-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
Reuse TLS sessions in HTTPS client #1499
Labels
feature request
Issues that request new features to be added to Node.js.
https
Issues or PRs related to the https subsystem.
Comments
Strangely enough, passing the result of var sessions = [];
get(function() {
get(function() {
require('assert').equal(sessions[0].toString('hex'), sessions[1].toString('hex'));
console.log('PASS');
});
});
function get(cb) {
return new Promise(function(resolve, reject) {
require('https').request(
{ host: 'github.com', headers: { connection: 'close' }, session: sessions[0] },
function(res) {
sessions.push(res.connection.getSession());
res.resume();
res.on('end', function() { cb(); });
})
.end();
})
} The first request passes, the second request fails with the following error:
io.js version 1.8.1. |
Add |
Fix is here: #2228 |
brendanashworth
added
the
feature request
Issues that request new features to be added to Node.js.
label
Jul 23, 2015
indutny
added a commit
to indutny/io.js
that referenced
this issue
Jul 27, 2015
Fix: nodejs#1499 PR-URL: nodejs#2228 Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
This was fixed in 2ca5a3d. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
feature request
Issues that request new features to be added to Node.js.
https
Issues or PRs related to the https subsystem.
The HTTPS client created via
require('https').request()
should reuse TLS sessions by default.Sample code:
/cc @indutny
The text was updated successfully, but these errors were encountered: