Skip to content

Instantly share code, notes, and snippets.

@edwinclement08
Created October 12, 2018 17:52
Show Gist options
  • Save edwinclement08/25283b215f28450f2ad37e3bb28b7131 to your computer and use it in GitHub Desktop.
Save edwinclement08/25283b215f28450f2ad37e3bb28b7131 to your computer and use it in GitHub Desktop.
#!/bin/bash
echo QUIT | openssl s_client -connect $DOMAIN_TO_FETCH_FROM:443 | sed -ne '/BEGIN CERT/,/END CERT/p' > my-cert
certutil -d sql:$HOME/.pki/nssdb -A -t "P,," -n my-cert -i my-cert
certutil -d sql:$HOME/.pki/nssdb -L
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment