/client-cert-nginx-node

an example node app getting client cert info from nginx

Primary LanguageJavaScript

TLS Client Certificates in node

A nodejs example of client-server https, using client certificates. The node server is behind nginx.

NOTE nginx itself requires and verifies the client certificate.

(as a bonus, there's also the recreateUrl function for express behind proxies)

Quick Start

nginx -c $PWD/nginx-tls-proxy.conf

npm install
node server.js

curl -ik https://localhost:8443/ --cert ca/certs/client.crt --key ca/private/client.key
node client.js

See also: