A little example of how to get mutual tls going in node, following this blog post https://engineering.circle.com/https-authorized-certs-with-node-js-315e548354a2.
- Clone and run
npm install
to get any dependencies (using onlyfs
andtls
) - Run
setup.sh
. This will go through all the steps:- Generate a new CA
- Generate the server's key and sign them with the CA
- Generate the client's keys and sign them with the CA (generates 2 clients)
- Establish a revocation list database
- Run
node server.js
to start the server - Run
node client.js 1
to start client 1 or2
for client 2. - To test revocation, run
revoke.sh
- Restart both server and client for the change to take effect