Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.DirectoryServices.Protocols: Force using LDAP V3 for SASL binding #109450

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

0xced
Copy link
Contributor

@0xced 0xced commented Nov 1, 2024

Fixes #109449

@0xced 0xced force-pushed the System.DirectoryServices.Protocols-LDAPV3 branch from 45c354d to 35100d4 Compare November 1, 2024 20:46
@0xced 0xced changed the title System.DirectoryServices.Protocols: Use LDAP V3 protocol by default System.DirectoryServices.Protocols: Force using LDAP V3 for SASL binding Nov 1, 2024
@steveharter
Copy link
Member

cc @BRDPM @grubioe @jay98014

@@ -127,6 +127,8 @@ private int BindSasl()
Marshal.StructureToPtr(defaults, ptrToDefaults, false);
try
{
// Bump up the protocol version because ldap_sasl_interactive_bind requires LDAP V3 else it returns LDAP_NOT_SUPPORTED and this ends up throwing LdapException: The feature is not supported.
SessionOptions.ProtocolVersion = 3;
Copy link
Member

Choose a reason for hiding this comment

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

For non-OSX, this must be working before the change above -- will this break V1\V2 users in those cases?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually I don't have a Linux machine to test. I tried to setup Kerberos + OpenLDAP in Docker to test on Linux but I couldn't create a working environment.

@0xced
Copy link
Contributor Author

0xced commented Nov 21, 2024

Note: I used https://github.com/0xced/dotnet-ldap-experiment to test this fix since building the .NET runtime repository and working on it in Rider on macOS is always a challenge!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.DirectoryServices community-contribution Indicates that the PR has been added by a community member
Projects
None yet
2 participants