我一直在使用API將訂單推送到客戶的BigCommerce商店很長一段時間,但是,BigCommerce最近開始拒絕連接和/或關閉連接。BigCommerce API連接問題/開始爲間歇性,現在更頻繁
我一直無法找到問題的根源,我希望有人經歷過和/或可以幫助找到此問題的根源。
以下是現在,我們正在對所有大商業API請求的響應:
消息:基礎連接已關閉:上一個發送發生意外的錯誤。
InnerException: System.IO.IOException:驗證失敗,因爲遠程方關閉了傳輸流。在 System.Net.Security.SslState.StartReadFrame(字節[]緩衝液,的Int32 的ReadBytes,AsyncProtocolRequest asyncRequest)在 System.Net.Security.SslState.StartReceiveBlob(字節[]緩衝液, AsyncProtocolRequest asyncRequest)在 System.Net .Security.SslState.StartSendBlob(字節[]來電,的Int32 計數,AsyncProtocolRequest asyncRequest)在 System.Net.Security.SslState.ForceAuthentication(布爾receiveFirst, 字節[]緩衝液,AsyncProtocolRequest asyncRequest)在 System.Net.Security .SslState.ProcessAuthentication(LazyAsyncResult lazyResult)at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext,Co ntextCallback回調,對象的狀態,布爾 preserveSyncCtx)在 System.Threading.ExecutionContext.Run(的ExecutionContext 的ExecutionContext,ContextCallback回調,對象的狀態,布爾 preserveSyncCtx)在 System.Threading.ExecutionContext.Run(的ExecutionContext 的ExecutionContext,ContextCallback回調,對象狀態) System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)at System.Net.TlsStream.Write(Byte [] buffer,Int32 offset,Int32 size)at System.Net.ConnectStream.WriteHeaders(Boolean async )
req = (HttpWebRequest)WebRequest.Create(baseURL);
req.AllowAutoRedirect = true;
req.ContentType = "application/json";
req.Accept = "application/json";
req.Method = "GET";
req.Headers.Add("X-Auth-Client", clientID);
req.Headers.Add("X-Auth-Token", AccessToken);
req.Headers.Add("Authorization", authValue);
using (WebResponse resp = req.GetResponse()) {
if (req.HaveResponse && resp != null) {
using (var reader = new StreamReader(resp.GetResponseStream())) {
jsonResponse = reader.ReadToEnd();
}
}
}
}
似乎與SSL有關。你可以忽略證書驗證嗎?或者顯示ssl相關的代碼? – 2017-03-02 03:32:18