我有一个用Ubuntu编写的服务,它在.NET上运行得很好,但当我在Ubuntu或官方docker镜像上运行它时,由于问题末尾包含的异常而无法运行。在所有平台上的所有情况下都使用‘`dotnet Asgard.Ihc.Api.dll’。我到处都在使用1.1.0版本。
我的代码是一个WCF客户端,它使用无效的证书调用遗留的SOAP/XML服务。为了解决这个问题,我补充道:
client.ClientCredentials.ServiceCertificate.SslCertificateAuthentication = new X509ServiceCertificateAuthentication()
{
CertificateValidationMode = X509CertificateValidationMode.None,
RevocationMode = X509RevocationMode.NoCheck
};然而,从异常情况来看,我最好的猜测是上面的代码不能在Linux上运行。
有人能证实或否认我的怀疑吗?
我还能不能绕过它?(我可以将证书添加到docker容器或主机吗?)
Unhandled Exception: System.AggregateException: One or more errors occurred.
(An error occurred while sending the request.) --->
System.ServiceModel.CommunicationException: An error occurred while sending the request. --->
System.Net.Http.HttpRequestException: An error occurred while sending the request. --->
System.Net.Http.CurlException: SSL connect error
at System.Net.Http.CurlHandler.ThrowIfCURLEError(CURLcode error)
at System.Net.Http.CurlHandler.MultiAgent.FinishRequest(StrongToWeakReference`1 easyWrapper, CURLcode messageResult)
--- End of inner exception stack trace ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.ServiceModel.Channels.ServiceModelHttpMessageHandler.<SendAsync>d__37.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at System.Net.Http.HttpClient.<FinishSendAsync>d__58.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.ServiceModel.Channels.HttpChannelFactory`1.HttpClientRequestChannel.HttpClientChannelAsyncRequest.<SendRequestAsync>d__13.MoveNext()
--- End of inner exception stack trace ---
at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result)
at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
at System.ServiceModel.Channels.ServiceChannelProxy.TaskCreator.<>c__DisplayClass1_0.<CreateGenericTask>b__0(IAsyncResult asyncResult)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Asgard.Ihc.Controller.IhcController.<Connect>d__15.MoveNext() in /home/tvl/Asgard.Ihc.Api/src/Asgard.Ihc.Controller/IhcController.cs:line 72
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at Asgard.Ihc.Api.IhcMonitor.Start() in /home/tvl/Asgard.Ihc.Api/src/Asgard.Ihc.Api/IhcMonitor.cs:line 23
at Asgard.Ihc.Api.Program.Main(String[] args) in /home/tvl/Asgard.Ihc.Api/src/Asgard.Ihc.Api/Program.cs:line 18发布于 2017-02-02 04:20:49
https://stackoverflow.com/questions/41774381
复制相似问题