Skip to content

Instantly share code, notes, and snippets.

@sebva
Created February 23, 2016 18:46
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save sebva/c2a8a2cf1b3157684a07 to your computer and use it in GitHub Desktop.
Save sebva/c2a8a2cf1b3157684a07 to your computer and use it in GitHub Desktop.
Renew/assign a Let's Encrypt certificate on an HP iLO 4 system
#!/bin/zsh
# Needs https://github.com/lukas2511/letsencrypt.sh in dns-01 mode
/opt/letsencrypt/ilo/letsencrypt.sh -c -s /opt/letsencrypt/ilo/ilo.csr -k /opt/letsencrypt/ilo/hook.sh -t dns-01 > /opt/letsencrypt/ilo/ilo.crt
cert=$(cat /opt/letsencrypt/ilo/ilo.crt)
curl --cacert /opt/letsencrypt/intermediate.pem -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Basic [FILL_IN_HERE]" -X POST -d "{\"Action\": \"ImportCertificate\", \"Certificate\": \"$cert\"}" https://ilo.home.vaucher.org/rest/v1/Managers/1/SecurityService/HttpsCert
@kgrzeslo
Copy link

@neilmunday
Copy link

neilmunday commented Oct 30, 2019

Can you describe how you generate intermediate.pem? Is the hook.sh script creating it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment