Technical Tip: How to generate CSR and import a certificate to FortiManager/FortiAnalyzer using API
- July 16, 2025
- 0 replies
- 730 views
| Description | This article describes how to generate a CSR, download the CSR, get it signed and import back to FortiManager/FortiAnalyzer using API. |
| Scope | FortiManager, FortiAnalyzer. |
| Solution |
POST: https://{{host}}/cgi-bin/module/flatui_proxy
{ "method": "post", "url": "/gui/sys/certificate/generate", "params": { "gen_name": "{{CERT_NAME}}", "id_type": 1, "gen_subject": "{{CERT_SUBJECT}}", "gen_unit": ["{{OU}}"], "gen_org": "{{ORG}}", "gen_city": "{{CITY}}", "gen_state": "{{STATE}}", "gen_country": "{{COUNTRY}}", "gen_email": "{{EMAIL}}", "gen_subj_alt_name": "", "key_type": 1, "gen_size": 2048, "curve_name": "secp256r1", "enroll_method": 0, "gen_url": "", "challenge_password": "" } }
{ "method": "get", "params": [ { "url": "/cli/global/system/certificate/local/{{CERT_NAME}}", "option": [ "get certinfo" ] } ], "id": "1" }
{ "method": "download", "url": "/gui/sys/certificate/local/entry", "params": { "key": "{{CERT_NAME}}" } }
POST: https://{{host}}/flatui/api/gui/system/certification/local
| Key | Value | Type | | ------------------- | ------------------- | ---- | | cert_name | {{CERT_NAME}} | Text | | cert_key_name | (leave empty) | Text | | password | (leave empty) | Text | | csrfmiddlewaretoken | {{csrf_token}} | Text | | csrf_token | {{csrf_token}} | Text | | filepath | Select Cert file | File |
Related documents: Technical Tip: Using FortiManager API Technical Tip: Certificate Generation with FIPS Enabled on FortiAnalyzer and FortiGate |
