用的是官方Demo测试公众号 通过code换取网页授权access_token和openid ,获取服务器返回时报错?
发布于 2 年前 作者 gshao 1112 次浏览 来自 分享

捕捉到 WxPayAPI.WxPayException

  Message=System.Net.WebException: 基础连接已经关闭: 发送时发生错误。 —> System.IO.IOException: 由于远程方已关闭传输流,身份验证失败。

   在 System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)

   在 System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)

   在 System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)

   在 System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)

   在 System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)

   在 System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)

   在 System.Net.TlsStream.CallProcessAuthentication(Object state)

   在 System.Threading.ExecutionContext.runTryCode(Object userData)

   在 System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)

   在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)

   在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)

   在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

   在 System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)

   在 System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)

   在 System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size)

   在 System.Net.ConnectStream.WriteHeaders(Boolean async)

   — 内部异常堆栈跟踪的结尾 —

   在 System.Net.HttpWebRequest.GetResponse()捕捉到 WxPayAPI.WxPayException

  Message=System.Net.WebException: 基础连接已经关闭: 发送时发生错误。 —> System.IO.IOException: 由于远程方已关闭传输流,身份验证失败。

   在 System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)

   在 System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)

   在 System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)

   在 System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)

   在 System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)

   在 System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)

   在 System.Net.TlsStream.CallProcessAuthentication(Object state)

   在 System.Threading.ExecutionContext.runTryCode(Object userData)

   在 System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)

   在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)

   在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)

   在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

   在 System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)

   在 System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)

   在 System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size)

   在 System.Net.ConnectStream.WriteHeaders(Boolean async)

   — 内部异常堆栈跟踪的结尾 —

   在 System.Net.HttpWebRequest.GetResponse()

这是什么奇怪问题,那位大神解答一下?

回到顶部