Skip to main content
anoushiravan
Staff
Staff
Nov 30, 2023 11:34 AM UTC

Technical Tip: FortiGate is unable to contact to LDAPS server, receives error message 'Can't contact LDAP server'

Description

This article describes that to authenticate the users via the LDAPS server, FortiGate should make a successful secure connection with the LDAPS server using port 636.

Scope

FortiGate, FortiProxy.

Solution

Case 1:

Generally, this issue happens when the issuer of the incoming certificate from the LDAPS server to FortiGate in the 'Server Hello' packet is not valid on FortiGate. In this case, it is possible to see the error message 'Alert (Level: Fatal, Description: Unknown CA)' in the PCAP file:

 

Shot-3.JPG

 

To check the imported CA certificate on FortiGate, run the following command and look for the imported CA certificate:

 

get vpn certificate ca details

 

Run the following sniffer command via CLI and then go to LDAPS config on FortiGate and select 'Test Connectivity' to see the possible reasons for a failed LDAPS connection:

 

diagnose sniffer packet any "host <LDAPS server IP> and port 636" 6 0 l

 

In this example, it is possible that the issuer of the imported CA certificate does not match the issuer of the certificate coming from the LDAPS server:

 

get vpn certificate ca details
== [ CA_Cert_1 ]
Name: CA_Cert_1
Subject: DC = com, DC = fortiserver, CN = fortiserver-SELBY-KVM09-CA
Issuer: DC = com, DC = fortiserver, CN = fortiserver-SELBY-KVM09-CA 

 

While the issuer of the incoming certificate from the LDAPS server is Fortiservice-UNIVERSE-ESX41-CA.

 

Shot-2.JPG

 

The issue is on the LDAPS server, and the certificate issue should be resolved on the LDAPS server side.

 

Case 2:

If the server is sending an immediate RESET in response to the Client Hello from the FortiGate, it might indicate that the user account is blocked on the AD server. Unblocking the user account on the AD server can resolve the issue.

 

LDAP-server-RESET.png

 

Note: From FortiOS v8.0, secure LDAP connections are enabled by default in the GUI, improving security by using encrypted LDAP communication to protect directory authentication traffic. Refer to the document for more information: Enable secure LDAP connection by default in the GUI.


Related articles:
Technical Tip: Cannot contact LDAP server message when enabled the LDAP over SSL configurations. 

Troubleshooting Tip: Status of LDAP server connected via IPsec VPN shows 'Can't contact LDAP server' 

    Thought Leadership. Security Summit. Thursday, November 12th, PGA National Resort, Palm Beach Gardens, FL.
    Security Operations Summit: Modernize SecOps. Operate AI-Native.AMER: November 4 | 9:00 AM PST. India and SAARC: November 5 | 10:00 AM IST. EMEA: November 5 | 10:30 AM CET. APAC: November 5 | 11:00 AM SGT