c# – .NET请求已中止:无法创建SSL / TLS安全通道
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了c# – .NET请求已中止:无法创建SSL / TLS安全通道,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含3544字,纯文字阅读大概需要6分钟。
内容图文
![c# – .NET请求已中止:无法创建SSL / TLS安全通道](/upload/InfoBanner/zyjiaocheng/787/1000cdb4e5844d8d9a2eb85db6098726.jpg)
我已经尝试过我为这个问题遇到的所有假设解决方案,但似乎没有任何效果.以下是蒸馏的跟踪日志(一个用于尝试与Paypal通信,另一个用于尝试与GetSentry通信):
System.Net Information: 0 : [10776] SecureChannel#49633458::.ctor(hostname=svcs.sandbox.paypal.com, #clientCertificates=0, encryptionPolicy=RequireEncryption)
System.Net Information: 0 : [10776] SecureChannel#49633458 - Left with 0 client certificates to choose from.
System.Net Information: 0 : [10776] Using the cached credential handle.
System.Net Information: 0 : [10776] InitializeSecurityContext(credential = System.Net.SafeFreeCredential_SECURITY, context = (null), targetName = svcs.sandbox.paypal.com, inFlags = ReplayDetect, SequenceDetect, Confidentiality, AllocateMemory, InitManualCredValidation)
System.Net Information: 0 : [10776] InitializeSecurityContext(In-Buffer length=0, Out-Buffer length=58, returned code=ContinueNeeded).
System.Net Information: 0 : [10776] InitializeSecurityContext(credential = System.Net.SafeFreeCredential_SECURITY, context = 69e8d930e0:cc64028eb0, targetName = svcs.sandbox.paypal.com, inFlags = ReplayDetect, SequenceDetect, Confidentiality, AllocateMemory, InitManualCredValidation)
System.Net Information: 0 : [10776] InitializeSecurityContext(In-Buffers count=2, Out-Buffer length=0, returned code=IllegalMessage).
System.Net Error: 0 : [10776] Exception in HttpWebRequest#2657604:: - The request was aborted: Could not create SSL/TLS secure channel..
System.Net Error: 0 : [10776] Exception in HttpWebRequest#2657604::GetResponse - The request was aborted: Could not create SSL/TLS secure channel..
System.Net Information: 0 : [10776] SecureChannel#39602548::.ctor(hostname=app.getsentry.com, #clientCertificates=0, encryptionPolicy=RequireEncryption)
System.Net Information: 0 : [10776] SecureChannel#39602548 - Left with 0 client certificates to choose from.
System.Net Information: 0 : [10776] Using the cached credential handle.
System.Net Information: 0 : [10776] InitializeSecurityContext(credential = System.Net.SafeFreeCredential_SECURITY, context = (null), targetName = app.getsentry.com, inFlags = ReplayDetect, SequenceDetect, Confidentiality, AllocateMemory, InitManualCredValidation)
System.Net Information: 0 : [10776] InitializeSecurityContext(In-Buffer length=0, Out-Buffer length=58, returned code=ContinueNeeded).
System.Net Information: 0 : [10776] InitializeSecurityContext(credential = System.Net.SafeFreeCredential_SECURITY, context = 69e8d930e0:cc64029510, targetName = app.getsentry.com, inFlags = ReplayDetect, SequenceDetect, Confidentiality, AllocateMemory, InitManualCredValidation)
System.Net Information: 0 : [10776] InitializeSecurityContext(In-Buffers count=2, Out-Buffer length=0, returned code=IllegalMessage).
System.Net Error: 0 : [10776] Exception in HttpWebRequest#49716141:: - The request was aborted: Could not create SSL/TLS secure channel..
System.Net Error: 0 : [10776] Exception in HttpWebRequest#49716141::GetResponse - The request was aborted: Could not create SSL/TLS secure channel..
我试过了
ServicePointManager.ServerCertificateValidationCallback +=
(sender, certificate, chain, sslPolicyErrors) => true;
以及(Global.asax.cs中的Application_Start)
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls;
似乎没有任何帮助.这是在MVC应用程序中的Windows 8.1 Pro框中.
解决方法:
看起来我正在使用的SharpRaven库版本强制ServicePointManager.SecurityProtocol到SSL3,打破任何后续调用.新的库版本没有这样做,但我仍然在执行我的调用之前明确地将它设置为TLS,只是为了好的措施.
内容总结
以上是互联网集市为您收集整理的c# – .NET请求已中止:无法创建SSL / TLS安全通道全部内容,希望文章能够帮你解决c# – .NET请求已中止:无法创建SSL / TLS安全通道所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。