Skip to content

Commit

Permalink
System.DirectoryServices.Protocols: Force using LDAP V3 for SASL binding
Browse files Browse the repository at this point in the history
Fixes #109449
  • Loading branch information
0xced committed Nov 1, 2024
1 parent 275ea58 commit 35100d4
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
return Interop.Ldap.ldap_sasl_interactive_bind(_ldapHandle, null, Interop.KerberosDefaultMechanism, IntPtr.Zero, IntPtr.Zero, Interop.LDAP_SASL_QUIET, LdapPal.SaslInteractionProcedure, ptrToDefaults);
}
finally
Expand Down

0 comments on commit 35100d4

Please sign in to comment.