Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PHP CA bundle updater
#!/usr/bin/env bash
set -o errexit -o pipefail -o nounset
IFS=$'\n\t'
ROOT_CRT="$(dirname $0)/root/root.crt"
CA_BUNDLE="$(dirname $0)/ca-bundle.pem"
echo -n "Downloading CA bundle... "
wget -q -O "$CA_BUNDLE" https://curl.haxx.se/ca/cacert.pem
echo "done"
echo -n "Appending my own root CA... "
echo "" >> "$CA_BUNDLE"
echo "JanTvrdik's Root CA" >> "$CA_BUNDLE"
echo "===================" >> "$CA_BUNDLE"
cat "$ROOT_CRT" >> "$CA_BUNDLE"
echo "done"
echo ""
echo "Printing CA bundle header for visual confirmation"
echo ""
head "$CA_BUNDLE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment