Skip to content

Instantly share code, notes, and snippets.

@deeso
Created September 4, 2020 23:30
Show Gist options
  • Save deeso/ca6111a566fdfcdc82e1c0d8cb877e99 to your computer and use it in GitHub Desktop.
Save deeso/ca6111a566fdfcdc82e1c0d8cb877e99 to your computer and use it in GitHub Desktop.
#!/bin/bash
curl -fLs -o /usr/local/bin/certstrap https://github.com/square/certstrap/releases/download/v1.2.0/certstrap-1.2.0-linux-amd64
chmod +x /usr/local/bin/certstrap
# no passphrases
certstrap init --common-name "CertAuth" --expires "100 years"
certstrap request-cert --common-name collector
certstrap sign collector --CA CertAuth --expires "100 years"
cp out/cert.crt ./cert.pem
cp out/cert.key ./key.pem
# pkcs12 format
openssl pkcs12 -export -out outputCert.p12 -inkey cert.key -in cert.crt -certfile CA.crt
rm -rf out/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment