Skip to main content
Rossguil
New Member
Dec 21, 2017 8:59 PM UTC
Question

Certificate update via API

Hello everyone,

I am trying to add (and eventually update) a certificate on our FortiWeb appliance by using the API. I have read in the documentation that something like this:

/usr/bin/curl -i -X POST -H 'Authorization: YWRtaW46' -H "Content-Type: application/json" -k -d @test.json https://192.168.118.41:90/api/v1.0/System/Certificates/Local; echo

is what I am supposed to do. The "test.json" file is a file containing a json object describing a certificate, the frame for which I have built using a GET request on the same resource:

/usr/bin/curl -iv -X GET -H 'Authorization: YWRtaW46' -H "Content-Type: application/json" -k https://192.168.118.41:90/api/v1.0/System/Certificates/Local; echo

 

I am getting an error 500 after the POST request. The error message is troubling, saying that "File is not an update file". My question is as follow:

What would be a "valid" update file and where can I find an example of a successful POST request for a new certificate?

 

 

I did not want to bump an old thread: https://forum.fortinet.com/tm.aspx?m=155127&tree=true

    3 replies

    Rossguil
    RossguilAuthor
    New Member
    Jan 18, 2018 7:42 PM UTC

    **Bumping for visibility**

    Translate
    JMK
    Visitor III
    Mar 30, 2022 3:34 PM UTC

    I would also like to know how to update a certificate via the api.

    Does anyone know.

    Translate
    sysram
    New Member
    Jun 12, 2023 12:40 PM UTC

    I created a quick and dirty Python Script to do that:
    https://github.com/righter83/Fortigate-API-VIP-Certificate

    Translate
    Risk and Resilience in the Age of AI. An OT Thought Leadership Summit for Houston's Critical Infrastructure Leaders. Date: Thursday, December 3, 2026. Time: 8:30 am - 1:30 pm (CT). Location: The Westin Houston, Memorial City | 945 Gessner Road, Houston, TX 77024