はSNICallbackと呼ばれるものを介して可能である:[?それは動的NodeJSでSSL証明書を戻すことができる]
https://github.com/nodejs/node/issues/10349#issuecomment-268157842
I cannot use SNICallback
var certs = {
"safe.myDomain.com": {
key: fs.readFileSync('../SSL/safe/private/key.pem'),
cert: fs.readFileSync('../SSL/safe/certs/cert.pem')
},
"api.myDomain.com": {
key: fs.readFileSync('../SSL/api/private/key.pem'),
cert: fs.readFileSync('../SSL/api/certs/cert.pem')
}
}
var httpsOptions = {
SNICallback: function(hostname, cb) {
var ctx = tls.createSecureContext(certs[hostname])
cb(null, ctx])
}
}
https.createServer(httpsOptions).listen(1443, function() {
console.log('HTTPS server is listening on port 1443')
})
の
可能な重複が( http://stackoverflow.com/questions/12219639/is-it-possible-to-dynamically-return-an-ssl-certificate-in-nodejs) – steampowered