mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
tls: add client-side session resumption support
This commit is contained in:
1 parent
b66d225c6e
commit
eb99083d0b
4 files changed
+186
No files matched your search
+19
@@ -184,6 +184,21 @@ CryptoStream.prototype.getPeerCertificate = function() {
|
||||
return null;
|
||||
};
|
||||
|
||||
CryptoStream.prototype.getSession = function() {
|
||||
if (this.pair.ssl) {
|
||||
return this.pair.ssl.getSession();
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
CryptoStream.prototype.isSessionReused = function() {
|
||||
if (this.pair.ssl) {
|
||||
return this.pair.ssl.isSessionReused();
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
CryptoStream.prototype.getCipher = function(err) {
|
||||
if (this.pair.ssl) {
|
||||
@@ -956,6 +971,10 @@ exports.connect = function(port /* host, options, cb */) {
|
||||
servername: options.servername || host
|
||||
});
|
||||
|
||||
if (options.session) {
|
||||
pair.ssl.setSession(options.session);
|
||||
}
|
||||
|
||||
var cleartext = pipe(pair, socket);
|
||||
|
||||
socket.connect(port, host);
|
||||
|
||||
Reference in new issue
Block a user