MongoDB GSSAPI身份验证在具有.NET Core 2.1的LINUX RHEL7上失败

MongoDB GSSAPI身份验证在具有.NET Core 2.1的LINUX RHEL7上失败,mongodb,mongodb-.net-driver,Mongodb,Mongodb .net Driver,我目前正在Linux上运行一个停靠的c#.NET Core 2.1应用程序 我的应用程序使用CreateGssapiCredential连接到windows上的Mongo,并按预期工作 当我尝试在linux中运行同一个应用程序时,它失败了,错误为“打开与服务器的连接时发生异常”。堆栈跟踪- { "ClassName": "System.DllNotFoundException", "Message": &

我目前正在Linux上运行一个停靠的c#.NET Core 2.1应用程序

我的应用程序使用CreateGssapiCredential连接到windows上的Mongo,并按预期工作

当我尝试在linux中运行同一个应用程序时,它失败了,错误为“打开与服务器的连接时发生异常”。堆栈跟踪-

{
        "ClassName": "System.DllNotFoundException",
        "Message": "Unable to load shared library 'security.dll' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libsecurity.dll: cannot open shared object file: No such file or directory",
        "Data": null,
        "InnerException": null,
        "HelpURL": null,
        "StackTraceString": "   at MongoDB.Driver.Core.Authentication.Sspi.NativeMethods.AcquireCredentialsHandle(String principal, String package, SecurityCredentialUse credentialUsage, IntPtr logonId, IntPtr identity, Int32 keyCallback, IntPtr keyArgument, SspiHandle& credentialHandle, Int64& timestamp)\n   at MongoDB.Driver.Core.Authentication.Sspi.SecurityCredential.Acquire(SspiPackage package, String username, SecureString password)\n   at MongoDB.Driver.Core.Authentication.GssapiAuthenticator.FirstStep..ctor(String serviceName, String hostName, String realm, String username, SecureString password, SaslConversation conversation)\n   at MongoDB.Driver.Core.Authentication.GssapiAuthenticator.GssapiMechanism.Initialize(IConnection connection, SaslConversation conversation, ConnectionDescription description)\n   at MongoDB.Driver.Core.Authentication.SaslAuthenticator.Authenticate(IConnection connection, ConnectionDescription description, CancellationToken cancellationToken)\n   at MongoDB.Driver.Core.Authentication.AuthenticationHelper.Authenticate(IConnection connection, ConnectionDescription description, IReadOnlyList`1 authenticators, CancellationToken cancellationToken)\n   at MongoDB.Driver.Core.Connections.ConnectionInitializer.InitializeConnection(IConnection connection, CancellationToken cancellationToken)\n   at MongoDB.Driver.Core.Connections.BinaryConnection.OpenHelper(CancellationToken cancellationToken)",
        "RemoteStackTraceString": null,
        "RemoteStackIndex": 0,
        "ExceptionMethod": null,
        "HResult": -2146233052,
        "Source": "MongoDB.Driver.Core",
        "WatsonBuckets": null,
        "TypeLoadClassName": null,
        "TypeLoadAssemblyName": null,
        "TypeLoadMessageArg": null,
        "TypeLoadResourceID": 0
    }
我遵循了这里的linux文档-

还有这里的GSSAPI/Kerberos文档-

这是设置连接的代码-

var settings = new MongoClientSettings
            {
                Credential = MongoCredential.CreateGssapiCredential(test@testdomain.com)
                .WithMechanismProperty("CANONICALIZE_HOST_NAME", canonicalizeHostName),
                Servers = servers.Split(',').Select(s => new MongoServerAddress(s, port))
            };

            Database = new MongoClient(settings).GetDatabase(databaseName);

            _collectionName = collectionName ?? typeof(T).Name;
            _collection = Database.GetCollection<T>(collectionName);
var设置=新的MongoClient设置
{
凭证=MongoCredential.CreateGssapiCredential(test@testdomain.com)
.WithMechanismProperty(“规范化主机名”,规范化主机名),
Servers=Servers.Split(',')。选择(s=>newmongoserver地址(s,端口))
};
数据库=新的MongoClient(设置).GetDatabase(数据库名称);
_collectionName=collectionName??类型(T)。名称;
_collection=Database.GetCollection(collectionName);

似乎没有什么能解决这个问题。如何让这个.NET core 2.1应用程序在使用GSSAPI的linux中工作?

它应该在2.12.0驱动程序版本中工作

GSSAPI linux支持尚未发布。检查下一个(2.12.0)小版本是的。非常感谢。