Description | This article describes how to troubleshoot FortiGate IPsec VPN when certificate-based authentication is enabled but the certificate private key fails to load from the certificate repository. |
Scope | FortiGate v7.0+. |
Solution |
Check both device configurations to make sure they have the same settings. Do some packet captures to see if there is communication between 2 devices and if there are packets that try to establish a VPN connection and enable ike debug logs.
To stop the debug, run the following commands:
diagnose debug disable diagnose debug reset
Note: More info about IPsec debug logging can be found on this KB article Troubleshooting Tip: IPsec VPNs tunnels but for this case, it is enough to check the problem.
If no logs are shown in the console, it can be possible to enable auto-negotiation under the phase2 interface:
config vpn ipsec phase2-interface edit Test-VPN
Note: More info about auto-negotiation can be found here: Technical Tip: Using the IPSec auto-negotiate and keepalive options
This line means that IPsec does not find any private key under the certificate repository. A simple check will show an empty certificate:
show full vpn certificate local CERTNAME config vpn certificate local set comments ''
The difference with a full content certificate where the most important parts private-key and certificate-content are available as per the below example:
config vpn certificate local set comments "" MIID8zCCAtugAwIBAgIIcGYcRpxVfuYwDQYJKoZIhvcNAQELBQAwgakxCzAJBgNV ***************************************************
In this case, there are some options to fix the issue:
config vpn certificate local edit "CERTNAME" set private-key "copy full content of private key here" set certificate "copy full content of certificate here" next end
After this change, IPsec VPN will come up. Always repeat steps 1-4 and also check if the certificate is properly imported/edited. |
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2025 Fortinet, Inc. All Rights Reserved.