tls: add client-side session resumption support

This commit is contained in:
Sean Cunningham authored and Ben Noordhuis committed 2011-09-07 20:01:14 +02:00
1 parent b66d225c6e
commit eb99083d0b
4 files changed
+186

No files matched your search

+19
View File
@@ -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);