dotnet/runtime

Linux System.DirectoryServices.Protocols: does the library support multiple server connection?

Open

#100,007 建立於 2024年3月20日

在 GitHub 查看
 (4 留言) (1 反應) (0 負責人)C# (5,445 fork)batch import
area-System.DirectoryServiceshelp wanted

倉庫指標

Star
 (17,886 star)
PR 合併指標
 (平均合併 12天 11小時) (30 天內合併 661 個 PR)

描述

If I create a connection and try to send request from Windows computer, then shut down the dc1 and resend the request it will succeed. I assume it will use the dc2.

var ldi = new LdapDirectoryIdentifier(new [] { "dc1.domain.com",  "dc2.domain.com" }, 389, false, false);
var conn = new LdapConnection(ldi, new NetworkCredential("user", "password")) 
{
    SessionOptions = {
      ProtocolVersion = 3
    }, 
    AuthType = AuthType.Basic
};

var req = new SearchRequest("", "(objectType=*)", SearchScope.Base, "defaultNamingContext");
conn.SendRequest(req);

If the same code executes on Linux machine it will fail with System.DirectoryServices.Protocols.LdapException: The operation was aborted because the client side timeout limit was exceeded. Does it depend on OpenLDAP library? Can I achieve the same result on Linux?

貢獻者指南