ldap: support insecure mode for Windows native LDAP#22152
Closed
jay wants to merge 3 commits into
Closed
Conversation
- 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
bagder
approved these changes
Jun 24, 2026
There was a problem hiding this comment.
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.verifypeeris disabled. - Updates WinLDAP SSL comment and adds a hard-error for the
verifypeer=off+verifyhost=oncombination.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
31e4ead to
8af46eb
Compare
Member
Author
|
I'm going to land this now instead of waiting for the feature window because it's technically a bug fix. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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