FortiWeb
A FortiWeb can be configured to join a Security Fabric through the root or downstream FortiGate.
yitoo_FTNT
Staff
Staff
Article Id 342766
Description

This article describes how to upload a local certificate to FortiWeb using the REST API.

 

local.png

Scope FortiWeb.
Solution
  1. Generate the token for Authorization using base64 encode.
  2. Use the following curl command to upload the certificate:

curl -vk --location 'https://10.109.20.107:8443/api/v2.0/system/certificate.local.import_certificate' \
--header 'Accept: application/json, text/plain, */*' \
--header 'Accept-Language: en-US,en;q=0.9' \
--header 'Cache-Control: no-cache' \
--header 'Connection: keep-alive' \
--header 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36' \
--header 'Authorization:eyJ1c2VybmFtZSI6ImFkbWluIiwicGFzc3dvcmQiOiJhZG1pbiIsInZkb20iOiJyb290In0=' \
--header 'sec-ch-ua: "Chromium";v="128", "Not;A=Brand";v="24", "Google Chrome";v="128"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "Windows"' \
--form 'type="certificate"' \
--form 'certificateFile=@"testapi.cer"' \
--form 'keyFile=@"testapi.key"' \
--form 'hsm="undefined"' \
--form 'password="undefined"'

 

testapi.png