Check out the Securing Ruby Applications with mTLS article to learn more about this repo's contents, as well as deeper insights on troubleshooting.
- Medium: https://medium.com/@jrothrock/securing-ruby-applications-with-mtls-bc7a7d836038
- Dev.to: https://dev.to/scoutapm/securing-ruby-applications-with-mtls-1gen
Sign up today for a free trial with Scout APM for your application performance needs:
Also checkout TelemetryHub. A receiver and exploration tool for OpenTelemetry signals:
-
chmod +x create_certs.sh
-
./create_certs.sh
-
docker build -t mtls .
-
docker run -p 443:443 -it mtls
-
In a separate terminal window:
curl https://localhost:443/ --cert ./client/client.crt --key ./client/client.key --cacert ./ca/ca.crt
-
(Or) use the combined PEM file
curl https://localhost:443/ --cert ./client/combined.pem --cacert ./ca/ca.crt
-
(Or) run the client.rb script:
ruby client.rb
This shouldn't be needed for the above, but is useful for looking at the handshake:
-
Using cURL with the -vvv flag:
curl -vvv https://localhost:443/ --cert ./client/combined.pem --cacert ./ca/ca.crt
-
Using s_client:
openssl s_client -connect localhost:443 -key ./client/combined.pem -CAfile ./ca/ca.crt