Gitea unable to login with LDAP TLS enabled (without ticking "Skip TLS Verify")

Hi ,

We are able to make gitea login work without LDAP TLS enabled. But when we enable TLS, by adding security protocol start TLS, we are forced to tick "Skip TLS Verify" to make login working. 

The error logs in openldap /var/log/slapd.log is as follows. Any help to enable TLS properly with gitea.

-regards
hutsys

[27-09-2023 14:08:37] slapd debug conn=3712 fd=80 ACCEPT from IP=192.xxx.xxx.xxxx:38436 (IP=0.0.0.0:389)
[27-09-2023 14:08:37] slapd debug conn=3712 op=0 EXT oid=1.3.6.1.4.1.1466.20037
[27-09-2023 14:08:37] slapd debug conn=3712 op=0 STARTTLS
[27-09-2023 14:08:37] slapd debug conn=3712 op=0 RESULT oid= err=0 qtime=0.000010 etime=0.000061 text=
[27-09-2023 14:08:37] slapd debug conn=3712 fd=80 closed (TLS negotiation failure)

Is LDAP server’s TLS certificate trusted on Gitea server? If it working with TLS but skipping verify, then it must be server running Gitea does not trust LDAP server certificate.