Support Forum
The Forums are a place to find answers on a range of Fortinet products from peers and product experts.
andrewr9072
New Contributor

FortiADC Automated Cert Through API

I am trying to automate the creation/renewal of Let's Encrypt certs through the REST API, but I cannot seem to get POST /system_certificate_local/automated to execute properly.

 

Even following the example formatting, I still can't get it to work. I can upload certs using the API with POST /system_certificate_localut only the automated portion gives me issues.

I can create an automated cert in the GUI using both ACME and DNS-01 challenge, so I know it is possible.

I am on v7.4 if that adds any context.

1 REPLY 1
shafiq23
Staff & Editor
Staff & Editor

Hi @andrewr9072,

 

You may use this curl command sample to send the POST request.

 

curl -ik -H "Accept: application/json" -H "Content-Type: application/json" -H "APITOKEN: <REST_API-TOKEN>" -X POST https://<FADC-IP>/api/system_certificate_local/automated -d payload.json

Use JSON payload format below and save it as a JSON file.


{
"ca_group": "",
"challenge_wait": "1",
"domain": "<your-domain>",
"email": "<your-email>",
"key_size": "2048",
"key_type": "RSA",
"mkey": "<certificate-name>",
"passwd": "",
"acme_service":"encrypt",
"challenge_type":"dns-01"
"vdom": "root"
}

You will then get a response that looks like below.

{"payload":{"Content":"q30tlfF8_gBFSvJ8ZNSk6IWRGgFR1C8VsWgxYVaThoU","Domain":"<your-domain>","Note":"Some DNS managers add quotes automatically, A single set is needed","Record":"_acme-challenge.<your-domain>","Type":"TXT"}}

Please let me know if this does not work. Thanks.

Regards,

Shafiq

Announcements
Check out our Community Chatter Blog! Click here to get involved
Labels
Top Kudoed Authors