服务器错误:请求已中止:无法创建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
最满意答案
虽然
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 ofstat
you have installed.When I run your
man/grep
combo, I actually get output since mystat
is GNU's version 8.2.I suggest you run
stat --version
to see which version you actually have, and thenstat -c %y /
to see if that format specifier works for your version. It may well be that yourman
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 thatbash
link, it's because it has this little beauty in it (which you should also see if you runman bash-builtins
and search forprintf
):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.
-
php字符串格式化(php string formating)[2019-11-29]
当$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 ...
-
动态字符串格式化(Dynamic string formating)[2023-04-06]
在你的操场上玩这个游戏......尝试不同的输入,少数字,一些人物等等...... 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”。 ...