I'm setting up a SNI Proxy to be able to dynamically handle SSL connections on different domains. I'm using an HTTPS server with node-http-proxy (last version) over node.js v0.12 which supports SNI callback.
var sniOptions = {
SNIcallback : function(){
//dynamically fetch SSL certificate here
}
}
https.createServer(sniOptions, function (req, res) {
// node-http-proxy logic routes request here
});
All good so far but I haven't find yet a way to reuse the same TLS session. Everytime a request is received a brand new TLS session is created and I want to avoid this. The only to resources strictly related to the topic are this issue on Github and this Paypal blog post.
Any suggestion about it?