小编Str*_*yck的帖子

C#HttpWebRequest SEC_I_RENEGOTIATE间歇性错误

我正在使用C#(.Net framework 3.5)应用程序中的SSL POST调用来处理登录/注销功能.通过HttpWebRequest :: BeginGetResponse()从服务器获取响应的工作时间为80%,但另外20%是间歇性抛出:

The request was aborted: Could not create SSL/TLS secure channel.
Run Code Online (Sandbox Code Playgroud)

我使用另一个问题中的建议文章启用了SSL跟踪.这在请求跟踪中产生了两种不同的模式.

似乎在执行期间,错误:

System.Net Error: 0 : [3680] Decrypt returned SEC_I_RENEGOTIATE.
Run Code Online (Sandbox Code Playgroud)

正在接收,导致重新启动安全上下文.当发生这种情况并且成功时,这是输出(注意我省略了实际地址):

System.Net Error: 0 : [3680] Decrypt returned SEC_I_RENEGOTIATE.
System.Net Information: 0 : [3680] InitializeSecurityContext(credential =   System.Net.SafeFreeCredential_SECURITY, context = 4bec0d0:4c0a8a8, targetName = [omitted].com, inFlags = ReplayDetect, SequenceDetect, Confidentiality, AllocateMemory, InitManualCredValidation)
System.Net Information: 0 : [3680] InitializeSecurityContext(In-Buffer length=0, Out-Buffer length=78, returned code=ContinueNeeded).
System.Net Information: 0 : [7148] InitializeSecurityContext(credential = System.Net.SafeFreeCredential_SECURITY, context = 4bec0d0:4c0a8a8, …
Run Code Online (Sandbox Code Playgroud)

c# error-handling ssl httpwebrequest

23
推荐指数
1
解决办法
9339
查看次数

标签 统计

c# ×1

error-handling ×1

httpwebrequest ×1

ssl ×1