Skip to main content
MigenaM
Staff
Staff
Jan 31, 2024 3:05 PM UTC

Troubleshooting Tip: Client Certificate SSL VPN authentication stops at 48% when virtual patching is enabled

Description This article describes how to handle cases where the Client Certificate SSL VPN authentication fails with the error 'Unable to establish the VPN connection. The VPN server may be unreachable, or your identity certificate is not trusted. (-5)'.
Scope FortiGate, SSL VPN, Client Certificate Authentication, Virtual Patching.
Solution

There are different scenarios when SSL-VPN authentication via FortiClient might fail. See the article Troubleshooting Tip: Possible reasons for FortiClient SSL VPN connectivity failure at specific percentages for an overview of several common reasons for connectivity failure. The example below demonstrates a possible reason why a connection may stop at 48% with the error message 'Unable to establish the VPN connection. The VPN server may be unreachable, or your identity certificate is not trusted. (-5)'.

 

Note that in this scenario, an X.509 certificate is used to authenticate the user, which is not a default configuration. See SSL VPN with certificate authentication for examples of SSL VPN user authentication using certificates.

 

Example diagnostics and debug commands:

 

diagnose debug disable

diagnose debug reset
diagnose vpn ssl debug-filter src-addr4 x.x.x.x    
<----- Replace x.x.x.x with the source public IP address of the FortiClient.
diagnose debug application sslvpn -1

diagnose debug console timestamp enable

diagnose debug enable

 

TLS handshake #1 stopped by FortiClient, no certificate sent:

 

2024-01-29 15:37:22 [298:root:d2e1]allocSSLConn:310 sconn 0x7f6d7e19d800 (0:root)

2024-01-29 15:37:22 [298:root:d2e1]SSL state:before SSL initialization (test user's IP)

2024-01-29 15:37:22 [298:root:d2e1]SSL state:fatal decode error (test user's IP)

2024-01-29 15:37:22 [298:root:d2e1]SSL state:error:(null)(test user's IP)

2024-01-29 15:37:22 [298:root:d2e1]SSL_accept failed, 1:unexpected eof while reading

2024-01-29 15:37:22 [298:root:d2e1]Destroy sconn 0x7f6d7e19d800, connSize=1. (root)

(ends with a

Alert Message

    Level: Fatal (2)

    Description: Decode Error (50)

 

TLS handshake #2 stopped by FortiGate after the client certificate is sent:

 

2024-01-29 15:37:23 [299:root:d2e2]allocSSLConn:310 sconn 0x7f6d7f254800 (0:root)

2024-01-29 15:37:23 [299:root:d2e2]SSL state:before SSL initialization (test user's IP)

2024-01-29 15:37:23 [299:root:d2e2]SSL state:before SSL initialization (test user's IP)

2024-01-29 15:37:23 [299:root:d2e2]got SNI server name: remoteaccess.domain.com realm (null)

2024-01-29 15:37:23 [299:root:d2e2]client cert requirement: yes

2024-01-29 15:37:23 [299:root:d2e2]SSL state:SSLv3/TLS read client hello (test user's IP)

2024-01-29 15:37:23 [299:root:d2e2]SSL state:SSLv3/TLS write server hello (test user's IP)

....

2024-01-29 15:37:23 [299:root:d2e2]SSL state:SSLv3/TLS write server done:(null)(test user's IP)

2024-01-29 15:37:23 [299:root:d2e2]SSL state:fatal decode error (test user's IP)

2024-01-29 15:37:23 [299:root:d2e2]SSL state:error:(null)(test user's IP)

2024-01-29 15:37:23 [299:root:d2e2]SSL_accept failed, 1:unexpected eof while reading

2024-01-29 15:37:23 [299:root:d2e2]Destroy sconn 0x7f6d7f254800, connSize=0. (root)

(ends with a

Alert Message

    Level: Fatal (2)

    Description: Decrypt Error (51)             

               

TLS handshake #3 passed, but the SSL VPN process receives a packet with no certificate:

 

2024-01-29 15:37:23 [300:root:d2e7]allocSSLConn:310 sconn 0x7f6d7e19d000 (0:root)

2024-01-29 15:37:23 [300:root:d2e7]SSL state:before SSL initialization (test user's IP)

2024-01-29 15:37:23 [300:root:d2e7]SSL state:before SSL initialization (test user's IP)

2024-01-29 15:37:23 [300:root:d2e7]got SNI server name: remoteaccess.domain.com realm (null)

2024-01-29 15:37:23 [300:root:d2e7]client cert requirement: yes

2024-01-29 15:37:23 [300:root:d2e7]SSL state:SSLv3/TLS read client hello (test user's IP)

2024-01-29 15:37:23 [300:root:d2e7]SSL state:SSLv3/TLS write server hello (test user's IP)

2024-01-29 15:37:23 [300:root:d2e7]SSL state:SSLv3/TLS write certificate (test user's IP)

....

2024-01-29 15:37:23 [300:root:d2e7]SSL state:SSLv3/TLS read client key exchange (test user's IP)

2024-01-29 15:37:23 [300:root:d2e7]SSL state:fatal decrypt error (test user's IP)

2024-01-29 15:37:23 [300:root:d2e7]SSL state:error:(null)(test user's IP)

2024-01-29 15:37:23 [300:root:d2e7]SSL_accept failed, 1:bad signature

2024-01-29 15:37:23 [300:root:d2e7]Destroy sconn 0x7f6d7e19d000, connSize=0. (root)

2024-01-29 15:37:23 [301:root:d2e7]allocSSLConn:310 sconn 0x7f6d7e180000 (0:root)

2024-01-29 15:37:23 [301:root:d2e7]SSL state:before SSL initialization (test user's IP)

2024-01-29 15:37:23 [301:root:d2e7]SSL state:before SSL initialization (test user's IP)

2024-01-29 15:37:23 [301:root:d2e7]got SNI server name: remoteaccess.domain.com realm (null)

2024-01-29 15:37:23 [301:root:d2e7]client cert requirement: yes

2024-01-29 15:37:23 [301:root:d2e7]SSL state:SSLv3/TLS read client hello (test user's IP)

2024-01-29 15:37:23 [301:root:d2e7]SSL state:SSLv3/TLS write server hello (test user's IP)

....

2024-01-29 15:37:23 [301:root:d2e7]SSL state:SSLv3/TLS write finished (test user's IP)

2024-01-29 15:37:23 [301:root:d2e7]SSL state:SSL negotiation finished successfully (test user's IP)

2024-01-29 15:37:23 [301:root:d2e7]SSL established: TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384

2024-01-29 15:37:23 [301:root:d2e7]No client certificate

 

Cause:

In this case, the issue was triggered when virtual-patch was enabled under a local-in-policy configured for the SSL VPN ports. Client certificate authentication is not compatible with the virtual patch feature. 

 

Review the local-in-policy configuration to verify if a policy handling SSL VPN traffic has virtual-patch enabled.

 

config firewall local-in-policy

    edit <index>

        set virtual-patch enable

        set service "TCP_LOCAL_SERVICES_GROUP"

    next

end

 

To mitigate the issue, the virtual-patch option must be disabled on the local-in-policy handling SSL VPN traffic to the firewall.

For more information on the virtual-patching option, see the documentation:

 

Note:
Another possible sequence of symptoms for this issue may be: the SSL VPN connection fails at 40%, goes back to 0% and then gets stuck again at 40%. In some cases, no error message is seen at all in the FortiClient. The root cause is having 'set virtual-patch enable' on a local-in policy that overlaps with the port of SSL VPN with certificate authentication.

    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