首页 \ 问答 \ 服务器错误:请求已中止:无法创建SSL / TLS安全通道(Server Error: The request was aborted: Could not create SSL/TLS secure channel)

服务器错误:请求已中止:无法创建SSL / TLS安全通道(Server Error: The request was aborted: Could not create SSL/TLS secure channel)

我收到错误The request was aborted: Could not create SSL/TLS secure channel. 根据cloudflare上的https端点请求。

码:

    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
    var wc = new WebClient();
    var json = wc.DownloadString("https://cloudflare.com");
    Console.Write(json);

这是Stack上常见的问题,其中将ServicePoint设置为TLS12可以修复它。 这在我当地修复了它。 但是每当我将代码提升到服务器时,错误就会回来(我很肯定我已经应用了代码更改。)如果我删除了https并使用http,它可以正常工作。

经过大量的搜索,我发现了这个KB: https//support.microsoft.com/en-us/kb/3109853我在Server1上安装了它,并没有解决问题。

谁知道还有什么可以尝试? 必须有一些关于导致此问题的服务器环境。 它是.Net修复/安全更新的最新版本。

[WebException: The request was aborted: Could not create SSL/TLS secure channel.]
   System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) +823
   System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar) +84

[HttpRequestException: An error occurred while sending the request.]
   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +181
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +66
   System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) +30
   TrackerBase.Controllers.<Verify>d__0.MoveNext() +535
   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +181
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +66
   System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) +30
   lambda_method(Closure , Task ) +40
   System.Web.Mvc.Async.TaskAsyncActionDescriptor.EndExecute(IAsyncResult asyncResult) +76
   System.Web.Mvc.Async.<>c__DisplayClass3f.<BeginInvokeAsynchronousActionMethod>b__3e(IAsyncResult asyncResult) +21
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +42
   System.Web.Mvc.Async.<>c__DisplayClass39.<BeginInvokeActionMethodWithFilters>b__33() +80
   System.Web.Mvc.Async.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() +386
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +42
   System.Web.Mvc.Async.<>c__DisplayClass2a.<BeginInvokeAction>b__20() +30
   System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +185
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +900
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +1299
   System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +27
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +22
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +43
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +22
   System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +38
   System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +42
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +22
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +38
   System.Web.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar) +18

I'm getting the error The request was aborted: Could not create SSL/TLS secure channel. on a request being made to a https endpoint on cloudflare.

Code:

    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
    var wc = new WebClient();
    var json = wc.DownloadString("https://cloudflare.com");
    Console.Write(json);

This is a commonly asked question on Stack, where setting the ServicePoint to TLS12 fixes it. That fixes it for me locally. However whenever I promote the code to the Server, the error comes back (and I'm positive my code changes have been applied.) If I remove the https and use http it works fine.

After tons of searching I found this KB: https://support.microsoft.com/en-us/kb/3109853 Which I installed on Server1, and it did not fix the problem.

Anyone know what else to try? There must be something about the Server environment that is causing this. It's up to date on .Net fixes/security updates.

[WebException: The request was aborted: Could not create SSL/TLS secure channel.]
   System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) +823
   System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar) +84

[HttpRequestException: An error occurred while sending the request.]
   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +181
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +66
   System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) +30
   TrackerBase.Controllers.<Verify>d__0.MoveNext() +535
   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +181
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +66
   System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) +30
   lambda_method(Closure , Task ) +40
   System.Web.Mvc.Async.TaskAsyncActionDescriptor.EndExecute(IAsyncResult asyncResult) +76
   System.Web.Mvc.Async.<>c__DisplayClass3f.<BeginInvokeAsynchronousActionMethod>b__3e(IAsyncResult asyncResult) +21
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +42
   System.Web.Mvc.Async.<>c__DisplayClass39.<BeginInvokeActionMethodWithFilters>b__33() +80
   System.Web.Mvc.Async.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() +386
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +42
   System.Web.Mvc.Async.<>c__DisplayClass2a.<BeginInvokeAction>b__20() +30
   System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +185
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +900
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +1299
   System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +27
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +22
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +43
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +22
   System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +38
   System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +42
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +22
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +38
   System.Web.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar) +18

原文:https://stackoverflow.com/questions/38042382
更新时间:2021-12-01 22:12

最满意答案

虽然printf可能是内置的bash,但stat不是。 因此,它完全取决于您安装的stat变体/版本。

运行你的man/grep组合时,我实际得到输出,因为我的stat是GNU的8.2版本。

我建议您运行stat --version来查看您实际拥有的版本然后使用stat -c %y /来查看该格式说明符是否适用于您的版本。 您的man页可能没有数据。

如果事实证明你的stat不支持你需要的格式说明符,你可以随时下载,编译和使用GNU的版本来解决问题。


就你为什么在bash链接中找不到%d ,这是因为它有这个小美(你应该看看你运行man bash-builtins并搜索printf ):

除了标准的printf(1)格式之外, printf解释了以下扩展......

换句话说,它只列出标准格式说明符的扩展名 。 如果你运行man 1 printf ,你会看到它支持:

...所有C格式规范以diouxXfeEgGcs之一diouxXfeEgGcs


While printf may be a bash built-in, stat is not. It therefore depends entirely on what variant/version of stat you have installed.

When I run your man/grep combo, I actually get output since my stat is GNU's version 8.2.

I suggest you run stat --version to see which version you actually have, and then stat -c %y / to see if that format specifier works for your version. It may well be that your man page is out of data.

If it turns out your stat does not support the format specifiers you need, you can always download, compile and use GNU's version to get around the problem.


In terms of why you can't find %d in that bash link, it's because it has this little beauty in it (which you should also see if you run man bash-builtins and search for printf):

In addition to the standard printf(1) formats, printf interprets the following extensions ...

In other words, it only lists the extensions to the standard format specifiers. If you run man 1 printf, you'll see it supports:

... all C format specifications ending with one of diouxXfeEgGcs.

相关问答

更多
  • 对。 它在Haxe中称为String Interpolation 。 Yup. It's called String Interpolation in Haxe.
  • 当$i不为零时,您需要添加& : $i=0; while ($row = mysql_fetch_array($result)) { $output .= ($i ? '&' : '') . "idno".$i."=".urlencode($row['usr_id']). '&'."res".$i."=".urlencode($row['responce']). '&'."sex".$i."=".urlencode($row['sex']). ...
  • 虽然printf可能是内置的bash,但stat不是。 因此,它完全取决于您安装的stat变体/版本。 当我运行你的man/grep组合时,我实际得到输出,因为我的stat是GNU的8.2版本。 我建议您运行stat --version来查看您实际拥有的版本,然后使用stat -c %y /来查看该格式说明符是否适用于您的版本。 您的man页可能没有数据。 如果事实证明你的stat不支持你需要的格式说明符,你可以随时下载,编译和使用GNU的版本来解决问题。 就你为什么在bash链接中找不到%d ,这是因为它 ...
  • Lars Kotthoff在评论中回答。 基本上,我用这种方式构建我的数据: { "key": "Fund 1", "values": [ { "x": "1999-11-05T02:00:00.000Z", "y": 1 }, { "x": "1999-11-13T02:00:00.000Z", "y": 1.00342088549313 ...
  • 我会说问题发生在第一步,当你在javascript中生成html并将其放入输入框时。 你在输入框中输入了真实的 - 未转义的html,这会弄乱页面的html。 您看到的结果可能是浏览器试图纠正它。 您需要在javascript函数中生成转义的html并将其放在输入框中。 所以没有< character,而是< ,no >但是> 等 你可以直接在你的javascript中更改它,或者你可以在SO上使用答案中的函数 。 I would say the problem occurs in the fi ...
  • 答案很简单:这是我在为绘图区域启用裁剪时引入的一个错误。 在某些情况下,这也会剪切轴标签。 partykit软件包的1.0-4版本修复了这个问题,并且已经可以在CRAN主服务器上找到http://CRAN.R-project.org/package=partykit 。 The answer is simple: It was a bug that I introduced when enabling clipping for the plotting regions. And in some circum ...
  • 将参数作为列表中的单独元素传递,并将字符串格式应用于最后一个元素,而不是subprocess.check_output()调用的输出: print subprocess.check_output( ["tasklist", "/V", "/S", serverl, "/U", domain + "\\" + username, "/P", password, "/FI", "USERNAME eq %s\\*" % domain]) 请注意,我还从最后一个参数中删除了'引用,将其留给s ...
  • stocks = ('san', 'bbva', 'ele') for i in stocks: queryTp = """SELECT date,close FROM %s _prices WHERE date >= '%s' """ % (i, datetime(2000,1,3)) print(queryTp) 适合我。 结果: SELECT date,close FRO ...
  • 在你的操场上玩这个游戏......尝试不同的输入,少数字,一些人物等等...... let format = "###/# ## XXX ## #### #(#)#" struct E:ErrorType { var txt = ""} func formated(str: String, formater: String) throws->String { var s = str.characters.generate() var res = "" let f = formate ...
  • date('Y-m-d H:i:s') === date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s'))); // Always true? 虽然这个陈述在大多数情况下都是正确的,但它并不总是正确的,因为左(date('Ymd H:i:s')是在正确的date('Ymd H:i:s')之后评估的,所以如果代码在第二个数字即将改变之前运行一个纳秒,则两个日期将具有不同的第二个数字。 您可以通过运行下面的代码来验证这两个语句并不总是相同,最终将打印“False”。 ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。