Skip to content

Instantly share code, notes, and snippets.

@arbal
Forked from userlerueda/fix_catalina_cert.sh
Created August 25, 2020 19:20
Show Gist options
  • Save arbal/a0f17b2628d944a9d25cdb8dbdadb20e to your computer and use it in GitHub Desktop.
Save arbal/a0f17b2628d944a9d25cdb8dbdadb20e to your computer and use it in GitHub Desktop.
Script to get certificate from web server and add to apple certificate store
#!/usr/bin/env bash
## To use this script, copy it to your ~/bin directory and then run it by executing:
## fix_catalina_cert.sh 10.201.146.172 443
## You will be asked to authenticate when storing in keychain
echo | openssl s_client -showcerts -servername ${1} -connect ${1}:${2} 2>/dev/null | openssl x509 -inform pem -out /tmp/untrusted.cer
security add-trusted-cert -k ~/Library/Keychains/login.keychain-db /tmp/untrusted.cer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment