Add client implementation of hello-mTLS using nodejs
Fixes smallstep/ca-component#138
This commit is contained in:
parent
8022ed80bc
commit
14fcf58903
5 changed files with 80 additions and 6 deletions
|
@ -9,7 +9,7 @@ var config = {
|
|||
ciphers: 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256',
|
||||
minVersion: 'TLSv1.2',
|
||||
maxVersion: 'TLSv1.2'
|
||||
}
|
||||
};
|
||||
|
||||
function createSecureContext() {
|
||||
return tls.createSecureContext({
|
||||
|
@ -24,7 +24,7 @@ var ctx = createSecureContext()
|
|||
|
||||
fs.watch(config.cert, (event, filename) => {
|
||||
if (event == 'change') {
|
||||
ctx = createSecureContext()
|
||||
ctx = createSecureContext();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -38,3 +38,5 @@ https.createServer({
|
|||
res.writeHead(200);
|
||||
res.end('hello nodejs\n');
|
||||
}).listen(443);
|
||||
|
||||
console.log("Listening on :443 ...");
|
Loading…
Add table
Add a link
Reference in a new issue