Skip to content

Instantly share code, notes, and snippets.

@widelec-BB
Created April 3, 2018 16:38
Show Gist options
  • Save widelec-BB/f975aa3533722ee6c1f61b8ebc143159 to your computer and use it in GitHub Desktop.
Save widelec-BB/f975aa3533722ee6c1f61b8ebc143159 to your computer and use it in GitHub Desktop.
#!/bin/sh
wget https://curl.haxx.se/ca/cacert.pem
awk 'BEGIN {c=0} v{v=v"\n"$0} /----BEGIN/{v=$0;c++}/----END/&&v { print v > "cert." c ".pem"; v=x}' cacert.pem
for file in *.pem; do mv "$file" "$(/gg/ssl/bin/openssl x509 -hash -noout -in "$file")".0; done
rm -rf cacert.pem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment