做网赌网站怎么推广拉人,网站seo分析报告,网站建设资料填写,商丘seo快速排名D365FO采用https#xff0c;第三方通过API调用的时候#xff0c;客户端不见得信任D365FO的证书#xff0c;调用时候会报 基础连接已关闭#xff0c;发送时发生错误#xff0c;调用堆栈如下#xff1a; 1 at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int…D365FO采用https第三方通过API调用的时候客户端不见得信任D365FO的证书调用时候会报 基础连接已关闭发送时发生错误调用堆栈如下 1 at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)2 at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count)3 at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)4 at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)5 at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)6 at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)7 at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)8 at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)9 at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
10 at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)
11 at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)
12 at System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size)
13 at System.Net.ConnectStream.WriteHeaders(Boolean async) 从调用堆栈看应该是跟SSL验证有关系。 当然有时候还会直接报基础连接已经关闭: 未能为 SSL/TLS 安全通道建立信任关系 这个就更直接了。 网上有很多解决办法目的是让https请求跳过客户端对SSL证书的验证。 1 ServicePointManager.SecurityProtocol SecurityProtocolType.Tls12;
2 ServicePointManager.ServerCertificateValidationCallback new RemoteCertificateValidationCallback(
3 (object caller,
4 X509Certificate certifacate,
5 X509Chain chain,
6 SslPolicyErrors erros) { return true; });
7 var request HttpWebRequest.Create(url); 这段代码一定要放到HttpWebRequest之前要不然回调的时候调不到方法。ServicePointManager.SecurityProtocol SecurityProtocolType.Tls12; 这一句也是必须的D365的协议版本是Tls12指定别的版本也不会跳过检查。