dsbenghe / Novell.Directory.Ldap.NETStandard

.NET LDAP client library for .NET Standard >= 2.0, .NET Core >=1.0, NET5/NET6/NET7/NET8 - works with any LDAP protocol compatible directory server (including Microsoft Active Directory).
MIT License
555 stars 151 forks source link

LdapException running in Docker #202

Closed mihaimyh closed 2 years ago

mihaimyh commented 2 years ago

I am getting an exception while I am trying to connect to LDAP from docker:

Error: LdapException: Unable to connect to server ad.local:636 (91) Connect Error
 System.Net.Internals.SocketExceptionFactory+ExtendedSocketException (101): Network is unreachable [fde1:53ba:e9a0:de11:b12a:3ef3:31ce:764a]:636
    at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
    at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
    at Novell.Directory.Ldap.ConnectTimeoutExtensions.Connect(Socket socket, IPEndPoint ipEndPoint, Int32 connectionTimeout)
    at Novell.Directory.Ldap.Connection.Connect(String host, Int32 port, Int32 semaphoreId)
 Error: LdapException: Unable to connect to server ad.local:636 (91) Connect Error
 System.Net.Internals.SocketExceptionFactory+ExtendedSocketException (101): Network is unreachable [fde1:53ba:e9a0:de11:b12a:3ef3:31ce:764a]:636
    at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
    at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
    at Novell.Directory.Ldap.ConnectTimeoutExtensions.Connect(Socket socket, IPEndPoint ipEndPoint, Int32 connectionTimeout)
    at Novell.Directory.Ldap.Connection.Connect(String host, Int32 port, Int32 semaphoreId)

The network seems to be up and running

root@1c4f3f3f12a6:/app# telnet ad.local 636
Trying 10.102.129.40...
Connected to ad.local.
Escape character is '^]'.

I am not sure why the LDAP connection is going through an IPv6 address.