mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5538] [Feature]: Add "Skip TLS Certificate Verification" option for LDAP/LDAPS #3866
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#3866
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @pr0l on GitHub (Jun 24, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5538
Originally assigned to: @NikanZeyaei on GitHub.
Is your feature request related to a problem?
Currently LDAP integration in 3x-ui requires a fully trusted TLS certificate chain when using LDAPS.
In enterprise environments, especially with Microsoft Active Directory Certificate Services (AD CS), LDAP servers often use certificates signed by an internal CA. If the CA certificate is not present in the system trust store, LDAP synchronization fails with:
LDAP fetch failed: LDAP Result Code 200 "Network Error":
tls: failed to verify certificate:
x509: certificate signed by unknown authority
While importing the CA certificate into the operating system is the preferred solution, there are situations where administrators may not have access to modify the trust store or may need a temporary workaround during deployment and testing.
Describe the solution you'd like
Add an optional checkbox in LDAP settings:
Skip TLS Certificate Verification
or
Allow Insecure TLS
When enabled, 3x-ui would establish LDAPS connections without validating the server certificate chain (equivalent to Go's InsecureSkipVerify: true).
Alternatives you've considered
Importing the internal CA certificate into the server trust store.
Replacing internal certificates with publicly trusted certificates.
These approaches are preferred for production environments but are not always practical or immediately available.
Concrete use case
This option should be disabled by default and clearly marked as insecure.
Mockups, screenshots, or examples
No response
Which parts of the panel would this affect?
No response
Are you willing to help?
Before submitting
@github-actions[bot] commented on GitHub (Jun 24, 2026):
This is a valid feature gap. The LDAP TLS configuration currently hardcodes
InsecureSkipVerify: falsein two places ininternal/util/ldap/ldap.go(lines 39 and 108), and there is no setting, database default, or frontend field for skipping certificate verification.What a PR would need to touch:
internal/util/ldap/ldap.go— AddInsecureSkipVerify boolto theConfigstruct and pass it into thetls.Configin bothFetchVlessFlagsandAuthenticateUser:internal/web/service/setting.go— Add"ldapInsecureSkipVerify": "false"to the defaults map (around line 114) and a correspondingGetLdapInsecureSkipVerify() (bool, error)getter.internal/web/job/ldap_sync_job.go— Pass the new setting when buildingldaputil.ConfiginRun().frontend/src/models/setting.tsandfrontend/src/schemas/setting.ts— Add theldapInsecureSkipVerifyfield to the model and Zod schema.frontend/src/pages/settings/GeneralTab.tsx— Add the checkbox to the LDAP settings section, clearly labelled as insecure, defaulting to off.The change is self-contained and the surface area is small. The suggested default of
false(disabled) is correct and aligns with the existingldapUseTLSpattern. A clear warning label in the UI (e.g. "Insecure — disables server certificate validation") would be appropriate.If you intend to submit a PR, following the existing pattern for boolean LDAP settings throughout those five files is sufficient.
This reply was generated automatically; a maintainer may follow up.