madhatter22 / LinqToLdap

C# LINQ provider built on top of System.DirectoryServices.Protocols for querying and updating LDAP servers.
MIT License
45 stars 23 forks source link

Linux Support - SSL Flag #25

Open Rob4001 opened 3 years ago

Rob4001 commented 3 years ago

As of .NET 5 System.DirectoryServices.Protocols has linux support, using the openldap c libraries.

These libraries do not support the UseSSL Flag: https://github.com/dotnet/runtime/issues/36888#issuecomment-648457142 which causes a PlatformNotSupportedException when trying to use this library

Could we put a runtime specific case around the setting of this flag ? https://github.com/madhatter22/LinqToLdap/blob/af3187632c70242ae76a86117994c95c771cb60c/LinqToLdap/ConnectionFactoryBase.cs#L138

https://github.com/dotnet/runtime/blob/c5ae5bf75635cb395d05567f6f37be2dc4a90afd/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.Linux.cs#L13

My current workaround is to duplicate the connection factories and override the BuildConnection call.

Thanks

MiC11w commented 2 years ago

I encountered the same problem, would really appreciate fixing this issue.

rklec commented 1 month ago

In modern .NET versions (like at least v6), this seems to be fixed; https://github.com/dotnet/runtime/blob/v6.0.0/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.Linux.cs