You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While using the System.DirectoryServices.Protocols library in .NET Core on Linux, attempting to set the LdapSessionOptions.VerifyServerCertificate callback results in an exception.
Exception Details:
Error in LdapSearch: "System.DirectoryServices.Protocols.LdapException: The LDAP server is unavailable. at System.DirectoryServices.Protocols.ErrorChecking.CheckAndSetLdapError(Int32 error) at System.DirectoryServices.Protocols.LdapSessionOptions.set_VerifyServerCertificate(VerifyServerCertificateCallback value)
Reproduction Steps
Use the following code snippet on a Linux environment:
using System;using System.DirectoryServices.Protocols;varldapConnection=new LdapConnection("ldaps://your-ldap-server:636"){SessionOptions={SecureSocketLayer=true,VerifyServerCertificate=(conn,cert)=>true// Ignore SSL validation}};
ldapConnection.Bind();2. Replace "ldaps://your-ldap-server:636"with your actual LDAP server and port.3. Run the code.4. Observe the exception.
### Expected behavior
The `VerifyServerCertificate` callback should allow bypassing SSL validation on Linux,as it does on Windows.
### Actual behavior
The callback throws an exception on Linux with the message: `System.DirectoryServices.Protocols.LdapException: The LDAP server is unavailable`.
Error in LdapSearch:"System.DirectoryServices.Protocols.LdapException: The LDAP server is unavailable. at System.DirectoryServices.Protocols.ErrorChecking.CheckAndSetLdapError(Int32 error) at System.DirectoryServices.Protocols.LdapSessionOptions.set_VerifyServerCertificate(VerifyServerCertificateCallback value)
### Regression?
The same code works without errors on Windows. However, it fails on Linux. This inconsistency prevents cross-platform development for applications using the System.DirectoryServices.Protocols library for LDAP.
Support the LdapSessionOptions.VerifyServerCertificate callback functionality on Linux, enabling developers to handle SSL certificate validation dynamically across platforms.
### Known Workarounds
_No response_
### Configuration
_No response_
### Other information
_No response_
The text was updated successfully, but these errors were encountered:
Description
Description
While using the
System.DirectoryServices.Protocols
library in .NET Core on Linux, attempting to set theLdapSessionOptions.VerifyServerCertificate
callback results in an exception.Exception Details:
Error in LdapSearch: "System.DirectoryServices.Protocols.LdapException: The LDAP server is unavailable. at System.DirectoryServices.Protocols.ErrorChecking.CheckAndSetLdapError(Int32 error) at System.DirectoryServices.Protocols.LdapSessionOptions.set_VerifyServerCertificate(VerifyServerCertificateCallback value)
Reproduction Steps
The text was updated successfully, but these errors were encountered: