Skip to content

ldap: support insecure mode for Windows native LDAP#22152

Closed
jay wants to merge 3 commits into
curl:masterfrom
jay:win_ldap_bypass_verify
Closed

ldap: support insecure mode for Windows native LDAP#22152
jay wants to merge 3 commits into
curl:masterfrom
jay:win_ldap_bypass_verify

Conversation

@jay

@jay jay commented Jun 24, 2026

Copy link
Copy Markdown
Member
  • Bypass cert verification if verifypeer is disabled.

Prior to this change libcurl lacked the ability to bypass certificate verification for Windows native LDAP (USE_WIN32_LDAP). A comment said "Win32 LDAP SDK does not support insecure mode without CA!" but I found that we can bypass the check by setting a verify callback to override Windows' internal verify check.

Closes #xxxx

- Bypass cert verification if verifypeer is disabled.

Prior to this change libcurl lacked the ability to bypass certificate
verification for Windows native LDAP (USE_WIN32_LDAP). A comment said
"Win32 LDAP SDK does not support insecure mode without CA!" but I found
that we can bypass the check by setting a verify callback to override
Windows' internal verify check.

Closes #xxxx
@jay jay added TLS LDAP Windows Windows-specific labels Jun 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds an “insecure” mode for LDAPS when using Windows native LDAP (USE_WIN32_LDAP) by allowing certificate verification to be bypassed when verifypeer is disabled, addressing a previously unsupported configuration in libcurl’s WinLDAP backend.

Changes:

  • Introduces a WinLDAP server-certificate callback that unconditionally accepts the server certificate.
  • Hooks that callback into the WinLDAP SSL path when conn->ssl_config.verifypeer is disabled.
  • Updates WinLDAP SSL comment and adds a hard-error for the verifypeer=off + verifyhost=on combination.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/ldap.c
Comment thread lib/ldap.c
Comment thread lib/ldap.c Outdated
jay added a commit to jay/sdk-api that referenced this pull request Jun 24, 2026
- Clarify that the incorrect VERIFYSERVERCERT function prototype is
  limited to some older SDKs.

Prior to this change the doc implied that the bad prototype was always
declared, but any recent SDK (including what is used to generate the
function prototype for the doc) does not have this issue.

Ref: curl/curl#22152 (comment)

Closes #xxxx
@jay jay force-pushed the win_ldap_bypass_verify branch from 31e4ead to 8af46eb Compare June 24, 2026 18:03
@jay

jay commented Jun 24, 2026

Copy link
Copy Markdown
Member Author

I'm going to land this now instead of waiting for the feature window because it's technically a bug fix.

@jay jay closed this in 4ce309d Jun 24, 2026
@jay jay deleted the win_ldap_bypass_verify branch June 24, 2026 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LDAP TLS Windows Windows-specific

Development

Successfully merging this pull request may close these issues.

3 participants