# Cannot get LDAPS to work

**URL:** <https://forum.gitea.com/t/cannot-get-ldaps-to-work/12304>\
**Category:** Install/Maintain/Configure\
**Created:** [July 7, 2026, 12:11pm UTC](https://forum.gitea.com/t/cannot-get-ldaps-to-work/12304 "2026-07-07T12:11:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gaetan](https://avatars.discourse-cdn.com/v4/letter/g/b77776/32.png) [@Gaetan](https://forum.gitea.com/u/Gaetan)\
**Post date:** [July 7, 2026, 12:11pm UTC](https://forum.gitea.com/t/cannot-get-ldaps-to-work/12304/1 "2026-07-07T12:11:27Z")

</div>

Hello,

I have installed Gitea 1.24.5, it is running fine but I cannot get it to synchronize with my Active Directory using LDAPS.

When I try to log in with an AD user, I get “Username or password is incorrect”. Here’s what the gitea.log says:

```auto
2026/07/07 12:42:56 .../ldap/source_search.go:269:realSearchEntry() [E] LDAP Connect error, 192.168.10.110:LDAP Result Code 200 "Network Error": read tcp 192.168.12.130:61484->192.168.10.110:636: wsarecv: An existing connection was forcibly closed by the remote host.

```

The windows firewall on my DC machine is open for LDAPS and my DC machine is accessible from my server:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/gitea/original/2X/b/b93d3a0d2f5a9b593cac50e2ab9b74890adce5bb.png)

However, the interesting thing is that if I configure my DC machine to not require singing and change the gitea configuration to Unencrypted/port 389, it works and the same username and password can log in.

If I try to use Unencrypted/port 389 with the encryption enabled on the DC server, I get this error in the log:

```auto
2026/07/07 08:53:39 .../ldap/source_search.go:308:realSearchEntry() [D] Failed to bind as BindDN[cn=Gitea,ou=MyGroup,dc=MyCompany,dc=local]: LDAP Result Code 8 "Strong Auth Required": 00002028: LdapErr: DSID-0C09035A, comment: The server requires binds to turn on integrity checking if SSL\TLS are not already active on the connection, data 0, v65f4 

```

Thank you

---

<div class="post-metadata">

**Author:** ![Gaetan](https://avatars.discourse-cdn.com/v4/letter/g/b77776/32.png) [@Gaetan](https://forum.gitea.com/u/Gaetan)\
**Post date:** [July 7, 2026, 12:12pm UTC](https://forum.gitea.com/t/cannot-get-ldaps-to-work/12304/2 "2026-07-07T12:12:29Z")

</div>

Here’s my Gitea configuration

 ![image](https://us1.discourse-cdn.com/flex020/uploads/gitea/original/2X/7/7ed1b3b5b7f28a3b93dd6c41bd834545acac2412.jpeg)

---

<div class="post-metadata">

**Author:** ![Gaetan](https://avatars.discourse-cdn.com/v4/letter/g/b77776/32.png) [@Gaetan](https://forum.gitea.com/u/Gaetan)\
**Post date:** [July 8, 2026, 9:20am UTC](https://forum.gitea.com/t/cannot-get-ldaps-to-work/12304/3 "2026-07-08T09:20:43Z")

</div>

Ok I had to generate a self-signed certificate on my domain controller and import it on my gitea machine (selecting “Skip TLS verify”)

See: [Configuring LDAPS with a Self-Signed Certificate in AD](https://www.it-connect.tech/active-directory-how-do-i-configure-ldaps-with-a-self-signed-certificate/)
