Skip to content

Instantly share code, notes, and snippets.

@jflyoo
Last active August 29, 2025 19:46
Show Gist options
  • Select an option

  • Save jflyoo/1943253013ce6167a83fe1a5b4c9d106 to your computer and use it in GitHub Desktop.

Select an option

Save jflyoo/1943253013ce6167a83fe1a5b4c9d106 to your computer and use it in GitHub Desktop.
Certificates

Gather SSL/TLS certificate

OpenSSL

url="www.example.com"
openssl s_client -connect ${url}:443 </dev/null | openssl x509 -outform PEM > ${url}.pem 

Add certificate to trusted store

Ubuntu

pem_path='/home/user/'
pem_filename='somecert.pem'
sudo cp ${pem_path}/${pem_filename} /usr/share/ca-certificates
#Add the filename to /etc/ca-certificates.conf; there are various ways to do this in a script
sudo update-ca-certificates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment