In the past, this had worked--it returned a result of OK, the cert was imported, the UI was reloaded to use the new cert, and all was well. It now doesn't work, and instead returns the error in the summary. fullchain.pem and privkey.pem are both PEM-encoded certificates and private keys, respectively.
Cannot reproduce using that command. I did add some input validation though for empty certs/keys and for adding the cert to caddy, which wasn't validated at all.
See https://www.truenas.com/community/threads/truecommand-2-issues.93712/post-692870 for further description.
I'm trying to automate importing a cert into TrueCommand using an API call which had worked previously:
curl -l -g --data '{"args" : { "pem" : "$(cat fullchain.pem)", "key" : "$(cat privkey.pem)" } }' -u "username:password" -X GET http://[IP_ADDRESS]/api/ssl/cert_import
In the past, this had worked--it returned a result of OK, the cert was imported, the UI was reloaded to use the new cert, and all was well. It now doesn't work, and instead returns the error in the summary. fullchain.pem and privkey.pem are both PEM-encoded certificates and private keys, respectively.