kubernetes GSSAPI操作失败,出现错误-请求的机制不受支持,对于使用C# / .net的Alpine 3.17容器上的NTLM

67up9zun  于 5个月前  发布在  Kubernetes
关注(0)|答案(1)|浏览(73)

我们在最新版本的alpine上使用最新版本的gss-ntlm时遇到了一个错误,我们遵循了https://github.com/mikeTWC1984/gssntlm的指导,并为alpine编译了它,并将其包含在构建中。
在微软升级到Alpine 3.17之前,它一直使用FROM mcr.microsoft.com/dotnet/runtime:6.0-alpine AS base工作得很好。我们已经能够通过指定FROM mcr.microsoft.com/dotnet/runtime:6.0-alpine3.16 AS base来让它工作。我们已经尝试在Alpine 3.17上重新编译gss-ntlm-但即使我们回到目标3.16,也会导致问题发生。任何想法都会有所帮助。
下面是来自日志的错误和堆栈跟踪:

Connection id "0HMQDJJ29MQO4", Request id "0HMQDJJ29MQO4:00000005": An unhandled exception was thrown by the application.
System.ComponentModel.Win32Exception (0x80090020): GSSAPI operation failed with error - An unsupported mechanism was requested.
at System.Net.Security.NegotiateStreamPal.AcquireCredentialsHandle(String package, Boolean isServer, NetworkCredential credential)
at System.Net.NTAuthentication.Initialize(Boolean isServer, String package, NetworkCredential credential, String spn, ContextFlagsPal requestedContextFlags, ChannelBinding channelBinding)
at System.Net.Http.AuthenticationHelper.SendWithNtAuthAsync(HttpRequestMessage request, Uri authUri, Boolean async, ICredentials credentials, Boolean isProxyAuth, HttpConnection connection, HttpConnectionPool connectionPool, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
at System.Net.Http.AuthenticationHelper.SendWithAuthAsync(HttpRequestMessage request, Uri authUri, Boolean async, ICredentials credentials, Boolean preAuthenticate, Boolean isProxyAuth, Boolean doRequestAuth, HttpConnectionPool pool, CancellationToken cancellationToken)
at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.HttpClient.\<SendAsync\>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
at System.ServiceModel.Channels.HttpChannelFactory`1.HttpClientRequestChannel.HttpClientChannelAsyncRequest.SendRequestAsync(Message message, TimeoutHelper timeoutHelper)          at System.ServiceModel.Channels.RequestChannel.RequestAsync(Message message, TimeSpan timeout)          at System.ServiceModel.Channels.RequestChannel.RequestAsyncInternal(Message message, TimeSpan timeout)          at System.Runtime.TaskHelpers.WaitForCompletionNoSpin[TResult](Task`1 task)
at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object\[\] ins, Object\[\] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object\[\] ins, Object\[\] outs)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(MethodCall methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(MethodInfo targetMethod, Object\[\] args)
at generatedProxy_1.LoadReport(LoadReportRequest )
at SsrsWebService.ReportExecutionServiceSoapClient.SsrsWebService.ReportExecutionServiceSoap.LoadReport(LoadReportRequest request) in /src/Connected Services/SSRSWebService/Reference.cs:line 4339
at SsrsWebService.ReportExecutionServiceSoapClient.LoadReport(TrustedUserHeader TrustedUserHeader, String Report, String HistoryID, ServerInfoHeader& ServerInfoHeader, ExecutionInfo& executionInfo) in /src/Connected Services/SSRSWebService/Reference.cs:line 4348
at XXXXX.Api.Utilities.SsrsBL.SSRSLogic.RunReport(SsrsReportDto report, Byte\[\]& fileBytes, String& OutputFileName, String& MimeType, String& error) in /src/SsrsBL/SsrsLogic.cs:line 59
at XXXXX.Api.Utilities.Controllers.SsrsReportController.GetReportBase(SsrsReportDto reportRequest) in /src/Controllers/SsrsReportController.cs:line 89
at XXXXX.Api.Utilities.Controllers.SsrsReportController.GetReport_NoAuth()
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object\[\] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.\<InvokeActionMethodAsync\>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)          at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)          at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)          at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)          at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()       --- End of stack trace from previous location ---          at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)          at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)          at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)          at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)          at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)          at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)          at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)          at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)          at Microsoft.AspNetCore.Builder.Extensions.UsePathBaseMiddleware.InvokeCore(HttpContext context, PathString matchedPath, PathString remainingPath)          at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)

字符串

zbwhf8kr

zbwhf8kr1#

它被打破,因为OpenSSL 3.0现在是默认的OpenSSL版本。OpenSSL 1.1可通过openssl1.1-compat包自Alpine 3.17。
https://www.alpinelinux.org/posts/Alpine-3.17.0-released.html
有开放的问题不仅在阿尔卑斯山。
https://bugs.launchpad.net/ubuntu/+source/gss-ntlmssp/+bug/1995915
有些人说试图在openssl.cnf中激活遗留提供程序是可行的解决方案(https://github.com/dotnet/runtime/issues/67353),但我在Alpine 3.18.4上通过dockerfile(https://gist.github.com/tothi/392dbb008ae0b60d25cfa4447bc21121)尝试了很多组合,包括新旧库,但没有帮助。
也许在这个问题解决之前(https://bugs.launchpad.net/ubuntu/+source/gss-ntlmssp/+bug/1995915)留在3.16上,使用旧的lib是最好的解决方案。

相关问题