Skip to content

Instantly share code, notes, and snippets.

@hapylestat
Last active November 2, 2021 00:17
Show Gist options
  • Save hapylestat/21db2feeecec4c2500b654e9dd2d2570 to your computer and use it in GitHub Desktop.
Save hapylestat/21db2feeecec4c2500b654e9dd2d2570 to your computer and use it in GitHub Desktop.
#!/bin/bash
MYHOST=$1
openssl s_client -showcerts -connect ${MYHOST}:443 </dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /etc/pki/ca-trust/source/anchors/nginx-selfsigned.crt
update-ca-trust; update-ca-trust extract
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment