Home / Acmefyer / FortiGate certificate
Renew FortiGate certificates automatically, with Let’s Encrypt.
On a FortiGate one certificate is used in several places: the admin interface, the SSL VPN, the authentication portal and VIPs. Every replacement means importing it and switching each of these places. Acmefyer obtains the certificate via ACME, for example for free from Let’s Encrypt, and an agent installs it through the FortiGate’s REST API and switches every place that uses it.
How to replace the SSL certificate on a FortiGate by hand.
The new certificate is imported under System → Certificates as a local certificate, with its key or as a PKCS#12 file. FortiOS does not replace a certificate in place: the new one gets a name of its own, and every place that uses the old one is switched individually. In the CLI for example:
config vpn ssl settings
set servercert "example-com-2027"
end
config system global
set admin-server-cert "example-com-2027"
end
Only when no place points to the old certificate any more can it be deleted.
- Every use
- Admin interface, SSL VPN, authentication portal, SAML connections and VIPs with SSL offloading each refer to the certificate on their own.
- Several systems
- Often the same wildcard certificate also sits on web servers and the mail system. The same replacement is then due there once more.
- How often
- Since March 2026 public certificates are valid for at most 200 days, from 2029 for only 47 days. The replacement is then due roughly every month.
The agent imports the certificate and switches every use.
The Acmefyer server obtains the certificate from Let’s Encrypt or another ACME certificate authority and renews it about 30 days before expiry. An Acmefyer agent on a Windows or Linux server near the FortiGate installs it through its REST API. It then switches every place that uses the previous certificate to the new one and removes the previous one.
Nothing is installed on the FortiGate itself. The Acmefyer server needs no access to the firewall: only the agent talks to it, from the network it is managed from.
- REST-API
- A REST API administrator with a token on the FortiGate. Enter the agent’s address as its trusted host. Acmefyer stores the token encrypted.
- Uses
- The first time, you choose where the certificate goes: admin interface, SSL VPN, authentication portal (also for the SAML sign-in of the IPsec dial-up VPN) or VIPs with SSL offloading.
- Renewal
- Every renewal arrives on the FortiGate under a name of its own with the date of issue. The agent switches every place that uses the previous certificate. The admin interface comes last, since it restarts briefly.
- Takeover
- Under “Take over from” you name certificates already on the FortiGate that are to be replaced, for example one bought before.
- Cleanup
- Finally the agent removes the previous certificates. Whatever is still in use somewhere stays, and its log names it.
- Validation
- With DNS-01 the FortiGate does not have to be reachable from the internet for the domain validation. This also covers a wildcard certificate.
- 01
Create API access
Create a REST API administrator with a token on the FortiGate, with the agent as trusted host.
- 02
Add a domain
For example vpn.example.com or *.example.com, with Let’s Encrypt and validation via DNS-01.
- 03
Create the deployment
Target FortiGate with address and token, then choose the agent and the uses.
- 04
Done
From now on Acmefyer renews the certificate in time and reports every result.
