.NET请求被中止:无法创建SSL/TLS安全通道
问题描述:
我已经尝试了我遇到过的每个应该解决的问题,但似乎没有任何工作。下面是蒸馏水跟踪日志(一个试图说服贝宝,和其他为试图去跟GetSentry):.NET请求被中止:无法创建SSL/TLS安全通道
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;
以及(的Application_Start全球.asax.cs)
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls;
似乎没什么帮助。这是在MVC应用程序的Windows 8.1 Pro框中。
答
它看起来像我使用的SharpRaven库版本是强制ServicePointManager.SecurityProtocol
SSL3,打破任何后续调用。新的库版本不会这样做,但是在执行我的调用之前,我仍然明确地将其设置为TLS,只是为了达到良好的效果。
我得到了同样的ambigious错误,最终ServicePointManager.SecurityProtocol被设置为不支持端点的值。请标记为答案。 – mlhDev 2016-01-22 19:42:37