Skip to content

Instantly share code, notes, and snippets.

@asieira
Created June 14, 2019 17:41
Show Gist options
  • Save asieira/097253a7041f9d0c74518ea2ffab3a05 to your computer and use it in GitHub Desktop.
Save asieira/097253a7041f9d0c74518ea2ffab3a05 to your computer and use it in GitHub Desktop.
Script to Import Brazilian root CAs (ICP Brasil) into Mac OS X system keychain
#!/usr/bin/env bash
mkdir tmp
cd tmp
curl http://acraiz.icpbrasil.gov.br/credenciadas/CertificadosAC-ICP-Brasil/ACcompactado.zip --output ACcompactado.zip
unzip ACcompactado.zip
rm *.zip
for file in *.crt
do
security add-trusted-cert -d -r trustAsRoot -k /Library/Keychains/System.keychain $file
done
rm *.crt
cd ..
@asieira
Copy link
Author

asieira commented Jun 14, 2019

PLEASE check the integrity of the ZIP file or download it through HTTPS using another machine which already trusts the necessary icpbrasil.gov.br certificate chain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment