Skip to content

Instantly share code, notes, and snippets.

@ibuziuk
Forked from rhopp/importCert.sh
Created January 15, 2020 08:55
Show Gist options
  • Save ibuziuk/2864459d1a65ff73daa5e085727c184d to your computer and use it in GitHub Desktop.
Save ibuziuk/2864459d1a65ff73daa5e085727c184d to your computer and use it in GitHub Desktop.
#!/bin/bash
## This script expects oc to be logged in into proper cluster, where you want the root cert to be imported from
oc get secret router-ca -n openshift-ingress-operator -o jsonpath="{.data.tls\.crt}" | base64 -d > ca.crt
certutil -d sql:$HOME/.pki/nssdb -A -t CT,C,C -n $(openssl x509 -in ca.crt -text |grep Issuer| grep -o 'ingress-operator@.*') -i ca.crt
rm ca.crt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment