Created on
09-30-2020
10:48 PM
Edited on
12-05-2025
01:45 AM
By
Jean-Philippe_P
Description
This article describes how to configure SSL VPN on FortiGate that requires users to authenticate using a certificate with LDAP UserPrincipalName (UPN) checking.
Scope
FortiGate.
Solution
Make sure the UPN is added as the subject alternative name as below in the client certificate.
This is present in the personal store on the client's PC.

Set Type to Certificate.
Choose the Certificate and Key files for the certificate, and enter the Password.


config user peer
edit "user1"
set ca "CA_Cert_1"
set ldap-server "ldap"
set ldap-mode principal-name #this will check the users second factor, the password, additional to the certificate against the LDAP server
next
end
Starting from FortiOS 7.4 version, the peer user can be configured as given below:
config user peer
edit "user1"
set ca "CA_Cert_1"
set mfa-mode subject-identity
set mfa-server "ldap"
next
end
Note:
When using a PKI object in the 'member' field, the group object’s behavior changes and the group will only match if the PKI object is true (the certificate is valid and trusted, and the user exists in LDAP) AND the group memberships obtained from LDAP for the user also match one of the remote LDAP groups defined.

Settings:
config vpn ssl settings
set reqclientcert enable
set servercert "ssl-vpn-server"
set tunnel-ip-pools "SSLVPN_TUNNEL_ADDR1"
set tunnel-ipv6-pools "SSLVPN_TUNNEL_IPv6_ADDR1"
set source-interface "port1"
set source-address "all"
set source-address6 "all"
set default-portal "full-access"
config authentication-rule
edit 1
set groups "ssl-vpn"
set portal "full-access"
next
end
end
Portal.
ssh vpn ssl web portal full-access
config vpn ssl web portal
edit "full-access"
set tunnel-mode enable
set ipv6-tunnel-mode enable
set web-mode enable
set ip-pools "SSLVPN_TUNNEL_ADDR1"
set split-tunneling disable
set ipv6-pools "SSLVPN_TUNNEL_IPv6_ADDR1"
next
end
Policy:
config firewall policy
edit 1
set name "ssl-access"
set uuid f64bd9ca-0180-51eb-bd8d-239943fc4b37
set srcintf "ssl.root"
set dstintf "port1"
set srcaddr "SSLVPN_TUNNEL_ADDR1"
set dstaddr "all"
set action accept
set schedule "always"
set service "ALL"
set groups "ssl-vpn"
set nat enable
next
end

diagnose debug disable
diagnose debug reset
diagnose vpn ssl debug-filter src-addr4 x.x.x.x <-- Public IP of the device connecting to SSL VPN.
diagnose debug application sslvpn -1
diagnose debug application fnbamd -1
diagnose debug console timestamp enable
diagnose debug enable
To disable debugging :
diagnose debug disable
diagnose debug reset
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.