Skip to content

Instantly share code, notes, and snippets.

@zerolagtime
Created October 1, 2025 15:21
Show Gist options
  • Select an option

  • Save zerolagtime/06dbe6673c9f35d0f5dc1f6146302077 to your computer and use it in GitHub Desktop.

Select an option

Save zerolagtime/06dbe6673c9f35d0f5dc1f6146302077 to your computer and use it in GitHub Desktop.
CA trust bundle convert and add to Linux
#!/bin/bash
infile=$1
outfile=$2
if [ ! -n "$infile" -o ! -f "$infile" ]; then
echo "No such input file \"$infile\""
echo "Usage: $0 [input.p7b] [output.pem]"
exit 1
fi
openssl pkcs7 -print_certs -inform der -in "$infile" -out "$outfile"
echo "Complete"
ls -l "$outfile"
echo "RedHat:"
echo " sudo install -D --mode 0644 \"$outfile\" /etc/pki/ca-trust/source/anchors"
echo " sudo update-ca-trust"
echo " trust list --filter=ca-anchors | grep label # search for your specific anchor"
echo "Ubuntu:"
echo " sudo install -D --mode 0644 \"$outfile\" /etc/ssl/certs"
echo " sudo update-ca-certificates"
echo " update-ca-certificates --list | grep -v 'trusted ca'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment