Closed hexadecatrienoic closed 7 years ago
I have the following TLS session handling code:
var secureServer = http2.createServer(options, requestHandler); const tlsSessionStore = {}; secureServer.on('newSession', function(id, data, cb) { tlsSessionStore[id.toString("hex")] = data; cb(); }); secureServer.on('resumeSession', function(id, cb) { cb(null, tlsSessionStore[id.toString("hex")] || null); }); secureServer.listen(443, '0.0.0.0');
This doesn't work with the http2 module (tickets work fine):
% openssl s_client -reconnect -state -prexit -connect <server>:443 2> /dev/null|grep -P "(New|Reused)" New, TLSv1.2, Cipher is ECDHE-RSA-AES128-GCM-SHA256 Reused, TLSv1.2, Cipher is ECDHE-RSA-AES128-GCM-SHA256 Reused, TLSv1.2, Cipher is ECDHE-RSA-AES128-GCM-SHA256 Reused, TLSv1.2, Cipher is ECDHE-RSA-AES128-GCM-SHA256 Reused, TLSv1.2, Cipher is ECDHE-RSA-AES128-GCM-SHA256 Reused, TLSv1.2, Cipher is ECDHE-RSA-AES128-GCM-SHA256 % openssl s_client -reconnect -state -prexit -no_ticket -connect <server>:443 2> /dev/null|grep -P "(New|Reused)" New, TLSv1.2, Cipher is ECDHE-RSA-AES128-GCM-SHA256 New, TLSv1.2, Cipher is ECDHE-RSA-AES128-GCM-SHA256 New, TLSv1.2, Cipher is ECDHE-RSA-AES128-GCM-SHA256 New, TLSv1.2, Cipher is ECDHE-RSA-AES128-GCM-SHA256 New, TLSv1.2, Cipher is ECDHE-RSA-AES128-GCM-SHA256 New, TLSv1.2, Cipher is ECDHE-RSA-AES128-GCM-SHA256
This works fine with the https module:
% openssl s_client -reconnect -state -prexit -connect <server>:443 2> /dev/null|grep -P "(New|Reused)" New, TLSv1.2, Cipher is ECDHE-RSA-AES128-GCM-SHA256 Reused, TLSv1.2, Cipher is ECDHE-RSA-AES128-GCM-SHA256 Reused, TLSv1.2, Cipher is ECDHE-RSA-AES128-GCM-SHA256 Reused, TLSv1.2, Cipher is ECDHE-RSA-AES128-GCM-SHA256 Reused, TLSv1.2, Cipher is ECDHE-RSA-AES128-GCM-SHA256 Reused, TLSv1.2, Cipher is ECDHE-RSA-AES128-GCM-SHA256 % openssl s_client -reconnect -state -prexit -no_ticket -connect <server>:443 2> /dev/null|grep -P "(New|Reused)" New, TLSv1.2, Cipher is ECDHE-RSA-AES128-GCM-SHA256 Reused, TLSv1.2, Cipher is ECDHE-RSA-AES128-GCM-SHA256 Reused, TLSv1.2, Cipher is ECDHE-RSA-AES128-GCM-SHA256 Reused, TLSv1.2, Cipher is ECDHE-RSA-AES128-GCM-SHA256 Reused, TLSv1.2, Cipher is ECDHE-RSA-AES128-GCM-SHA256 Reused, TLSv1.2, Cipher is ECDHE-RSA-AES128-GCM-SHA256
This issue has been resolved in the official HTTP/2 API.
I have the following TLS session handling code:
This doesn't work with the http2 module (tickets work fine):
This works fine with the https module: