FortiGate
FortiGate Next Generation Firewall utilizes purpose-built security processors and threat intelligence security services from FortiGuard labs to deliver top-rated protection and high performance, including encrypted traffic.
nithincs
Staff & Editor
Staff & Editor
Article Id 334798
Description

This article describes how to resolve an issue where LDAP authentication intermittently fails for FortiGate admin login, an VPN authentication or captive portal and fnbamd show the debug error code 'ldap_error-Ret 10, st = 3'.

Scope FortiGate.
Solution

In some scenarios, a delay in the response from the server for a Bind Request or searchRequest may occur, as shown in the following example:

 

Working LDAP communication capture:

 

working.JPG

 

In the 33rd packet, server 10.1.1.1 took 7 seconds to process and respond to the FortiGate bindRequest sent in the 31st packet.

 

In newer versions of FortiOS, 'ldapconntimeout' will be applied for the LDAP/TACACS+/POP3 response. If FortiGate fails to get server response within the ldapconntimeout period (500 milliseconds by default), FortiGate will send the fin packet to the server.

 

nonworkingldap.JPG

 

In the above capture, FortiGate sends TCP packets with the fin flag (11th packet), after 500 milliseconds of bindRequest.

 

In the fnbamd debug, the following messages will be seen as well.

 

2024-08-20 17:25:13 [984] __ldap_next_state-State: DN Search -> User Binding
2024-08-20 17:25:13 [1325] __ldap_rxtx-Start ldap conn timer.
2024-08-20 17:25:13 [1221] __ldap_rxtx-fd 10, state 3(User Binding)
2024-08-20 17:25:13 [1223] __ldap_rxtx-Stop ldap conn timer.
2024-08-20 17:25:13 [1232] __ldap_rxtx-
2024-08-20 17:25:13 [708] fnbamd_ldap_build_userbind_req-Trying DN 'CN=labtestuser,OU=users,OU=BNG,DC=FTNTLAB,DC=NET'
2024-08-20 17:25:13 [472] __ldap_build_bind_req-Binding to 'CN=labtestuser,OU=users,OU=BNG,DC=FTNTLAB,DC=NET'
2024-08-20 17:25:13 [1261] fnbamd_ldap_send-sending 110 bytes to 10.1.1.1
2024-08-20 17:25:13 [1274] fnbamd_ldap_send-Request is sent. ID 3
2024-08-20 17:25:13 [1120] __ldap_auth_ctx_reset-
2024-08-20 17:25:13 [1257] __ldap_rxtx-Start ldap conn timer.
2024-08-20 17:25:13 [594] __ldap_conn_timeout-Connction with FTNTLABLDAP:10.1.1.1 timed out.
2024-08-20 17:25:13 [1642] __ldap_error-Ret 10, st = 3.
2024-08-20 17:25:13 [1679] __ldap_error-
2024-08-20 17:25:13 [1485] __ldap_tcps_close-closed.
2024-08-20 17:25:13 [1567] __ldap_conn_stop-Stop ldap conn timer.
2024-08-20 17:25:13 [2614] fnbamd_ldap_result-Error (10) for req 54594232432117

 

The solution is to increase the 'ldapconntimeout' value under global settings, depending on the delay in response by the server.

In the above example, around 7 seconds of delay are seen in response, so it can be increased to around 10000 milliseconds to avoid user authentication failure due to the ldapconntimeout timer. It may be set up to 300,000 milliseconds.

 

config system global

set ldapconntimeout 10000

end