Skip to content

Instantly share code, notes, and snippets.

@jbussdieker
Created March 12, 2018 09:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbussdieker/902e3df9df22119a2ca70ada801c8f8c to your computer and use it in GitHub Desktop.
Save jbussdieker/902e3df9df22119a2ca70ada801c8f8c to your computer and use it in GitHub Desktop.
Adding SANs to FreeIPA
# Add SANs for Apache service
ipa service-add-principal HTTP/${hostname}@${realm} HTTP/freeipa.${domain}@${realm}
ipa service-add-principal HTTP/${hostname}@${realm} HTTP/freeipa@${realm}
HTTPD_CERT_ID=$(getcert list -d /etc/httpd/alias | grep "Request ID" | cut -d"'" -f 2)
getcert resubmit -i ${HTTPD_CERT_ID} -D freeipa.${domain} -D freeipa
while ! getcert list -d /etc/httpd/alias | grep status | grep MONITORING; do
log "Waiting for HTTPD certificate to be reissued"
done
# Add SANs for LDAP service
ipa service-add-principal ldap/${hostname}@${realm} ldap/freeipa.${domain}@${realm}
ipa service-add-principal ldap/${hostname}@${realm} ldap/freeipa@${realm}
REALM_HYPHEN=$(echo $realm | sed 's/\./\-/g')
LDAP_CERT_ID=$(getcert list -d "/etc/dirsrv/slapd-${REALM_HYPHEN}" | grep "Request ID" | cut -d"'" -f 2)
getcert resubmit -i ${LDAP_CERT_ID} -D freeipa.${domain} -D freeipa
while ! getcert list -d "/etc/dirsrv/slapd-${REALM_HYPHEN}" | grep status | grep MONITORING; do
log "Waiting for LDAP certificate to be reissued"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment