I've made some progress, but have now come up against another stumbling block. So this is what's unfolded so far...
First, I might have got further if I had my local DNS server resolve ilo.udance.com.au
to the IP address of the ILO
Once past that point, I managed to fetch the CSR from the ILO.
root@ilo:~ # hpilo_cli -l Administrator -i ilo.udance.com.au certificate_signing_request country= state= locality= organization= organizational_unit= common_name=ilo.udance.com.au
Password for Administrator@ilo.udance.com.au:
Traceback (most recent call last):
File "/usr/local/bin/hpilo_cli", line 334, in <module>
main()
File "/usr/local/bin/hpilo_cli", line 214, in main
results = [getattr(ilo, method)(**params)]
File "/usr/local/lib/python3.7/site-packages/hpilo.py", line 877, in certificate_signing_request
return self._control_tag('RIB_INFO', 'CERTIFICATE_SIGNING_REQUEST', elements=elements)
File "/usr/local/lib/python3.7/site-packages/hpilo.py", line 764, in _control_tag
header, message = self._request(root)
File "/usr/local/lib/python3.7/site-packages/hpilo.py", line 253, in _request
message = self._parse_message(data)
File "/usr/local/lib/python3.7/site-packages/hpilo.py", line 618, in _parse_message
raise subclass(message, status)
hpilo.IloGeneratingCSR: The iLO subsystem is currently generating a Certificate Signing Request(CSR), run script after 10 minutes or more to receive the CSR.
Repeating the command a few minutes later:
root@ilo:~ # hpilo_cli -l Administrator -i ilo.udance.com.au certificate_signing_request country= state= locality= organization= organizational_unit= common_name=ilo.udance.com.au > ilo.csr
Password for Administrator@ilo.udance.com.au:
Contents of ilo.csr
>>> print(my_ilo.certificate_signing_request(country="", state="", locality="", organization="", organizational_unit="", common_name="ilo.udance.com.au"))
-----BEGIN CERTIFICATE REQUEST-----
[REDACTED]
-----END CERTIFICATE REQUEST-----
Using the acme.sh client and Cloudflare DNS API, I then issued the CSR to Let's Encrypt to generate a certificate.
root@ilo:~ # acme.sh --signcsr --csr ilo.csr --dns dns_cf
[Fri Oct 30 04:39:47 AWST 2020] Copy csr to: /root/.acme.sh/ilo.udance.com.au/ilo.uda
[Fri Oct 30 04:39:48 AWST 2020] Using CA: https://acme-v02.api.letsencrypt.org/direct
[Fri Oct 30 04:39:49 AWST 2020] Create account key ok.
[Fri Oct 30 04:39:49 AWST 2020] Registering account: https://acme-v02.api.letsencrypt
[Fri Oct 30 04:39:52 AWST 2020] Registered
[Fri Oct 30 04:39:52 AWST 2020] ACCOUNT_THUMBPRINT='ZAit-0gx4lTGwxDuPXXCDGBdepiJaKpbR
[Fri Oct 30 04:39:52 AWST 2020] Signing from existing CSR.
[Fri Oct 30 04:39:52 AWST 2020] Getting domain auth token for each domain
[Fri Oct 30 04:39:54 AWST 2020] Getting webroot for domain='ilo.udance.com.au'
[Fri Oct 30 04:39:54 AWST 2020] Adding txt value: 5C9-HoPF-69bT1Y0kNqQoFJaQFmG4DkbDK0omain: _acme-challenge.ilo.udance.com.au
[Fri Oct 30 04:39:56 AWST 2020] Adding record
[Fri Oct 30 04:39:56 AWST 2020] Added, OK
[Fri Oct 30 04:39:56 AWST 2020] The txt record is added: Success.
[Fri Oct 30 04:39:56 AWST 2020] Let's check each DNS record now. Sleep 20 seconds fir
[Fri Oct 30 04:40:17 AWST 2020] Checking ilo.udance.com.au for _acme-challenge.ilo.ud
[Fri Oct 30 04:40:18 AWST 2020] Domain ilo.udance.com.au '_acme-challenge.ilo.udance.s.
[Fri Oct 30 04:40:18 AWST 2020] All success, let's return
[Fri Oct 30 04:40:18 AWST 2020] Verifying: ilo.udance.com.au
[Fri Oct 30 04:40:22 AWST 2020] Pending
[Fri Oct 30 04:40:26 AWST 2020] Pending
[Fri Oct 30 04:40:29 AWST 2020] Pending
[Fri Oct 30 04:40:32 AWST 2020] Pending
[Fri Oct 30 04:40:36 AWST 2020] Pending
[Fri Oct 30 04:40:39 AWST 2020] Pending
[Fri Oct 30 04:40:42 AWST 2020] Success
[Fri Oct 30 04:40:42 AWST 2020] Removing DNS records.
[Fri Oct 30 04:40:42 AWST 2020] Removing txt: 5C9-HoPF-69bT1Y0kNqQoFJaQFmG4DkbDK0qxESn: _acme-challenge.ilo.udance.com.au
[Fri Oct 30 04:40:44 AWST 2020] Removed: Success
[Fri Oct 30 04:40:44 AWST 2020] Verify finished, start to sign.
[Fri Oct 30 04:40:44 AWST 2020] Lets finalize the order.
[Fri Oct 30 04:40:44 AWST 2020] Le_OrderFinalize='https://acme-v02.api.letsencrypt.ore/100737052/5937392711'
[Fri Oct 30 04:40:46 AWST 2020] Downloading cert.
[Fri Oct 30 04:40:46 AWST 2020] Le_LinkCert='https://acme-v02.api.letsencrypt.org/acmbb41a491c15b91b4ba45343098972'
[Fri Oct 30 04:40:47 AWST 2020] Cert success.
-----BEGIN CERTIFICATE-----
[REDACTED]
-----END CERTIFICATE-----
[Fri Oct 30 04:40:47 AWST 2020] Your cert is in /root/.acme.sh/ilo.udance.com.au/ilo.cer
[Fri Oct 30 04:40:47 AWST 2020] The intermediate CA cert is in /root/.acme.sh/ilo.ud.cer
[Fri Oct 30 04:40:47 AWST 2020] And the full chain certs is there: /root/.acme.sh/ilu/fullchain.cer
Attempting to install the resulting certificate...
root@ilo:~/.acme.sh/ilo.udance.com.au # hpilo_cli -l Administrator -i ilo.udance.com.au import_certificate certificate=ilo.udance.com.au.cer
Password for Administrator@ilo.udance.com.au:
Traceback (most recent call last):
File "/usr/local/bin/hpilo_cli", line 334, in <module>
main()
File "/usr/local/bin/hpilo_cli", line 214, in main
results = [getattr(ilo, method)(**params)]
File "/usr/local/lib/python3.7/site-packages/hpilo.py", line 1390, in import_certificate
return self._control_tag('RIB_INFO', 'IMPORT_CERTIFICATE', text=certificate)
File "/usr/local/lib/python3.7/site-packages/hpilo.py", line 764, in _control_tag
header, message = self._request(root)
File "/usr/local/lib/python3.7/site-packages/hpilo.py", line 253, in _request
message = self._parse_message(data)
File "/usr/local/lib/python3.7/site-packages/hpilo.py", line 619, in _parse_message
raise IloError(message, status)
hpilo.IloError: Error: Line #1: syntax error near "ilo.cer".. You may have tried to use a feature this iLO version or firmware version does not support.
I'm so close, but I'm now stumped again.
EDIT: I've finally got it working. The syntax was incorrect. Created a short script to test with the lines...
CERTFILE="/root/.acme.sh/ilo.udance.com.au/ilo.udance.com.au.cer"
hpilo_cli -l Administrator -p [REDACTED] ilo.udance.com.au import_certificate certificate="$(cat $CERTFILE)"
...and the import succeeded!
Thank you @xyzzy and to everybody else who helped me along the way to try to figure out a way to get ahead. 