XmlReader.Create错误“无法创建SSL / TLS安全通道”(XmlReader.Create error “Could not create SSL/TLS secure channel”)
在我的基于ASP.net的网站上,我从几个网站汇总了我的活动源。 其中一个是
https://github.com/lucamauri.atom
上的GitHub feed:这是一个有效的提要,可以通过网络浏览器正确读取,并且自从几周前在我的网站上正常工作。 从那以后,它开始产生错误在代码中,我首先创建和
XMLReader
,然后将其加载到SyndicationFeed
对象中,如下所示:Dim TempReader As System.Xml.XmlReader = System.Xml.XmlReader.Create(TempString) Dim SyndFeed As SyndicationFeed = SyndicationFeed.Load(TempReader) Dim TempItems As New List(Of SyndicationItem) TempItems.AddRange(SyndFeed.Items.ToList.GetRange(0, Math.Min(CurrentFeed.TotalElements, SyndFeed.Items.Count)))
这适用于多个提要,但是GitHub现在在上面的代码的第一行生成TLS错误:
System.Net.WebException:请求已中止:无法创建SSL / TLS安全通道。
在System.Xml.XmlDownloadManager.GetNonFileStream上的System.Net.HttpWebRequest.GetResponse()(Uri uri,ICredentials凭据,IWebProxy代理,RequestCachePolicy cachePolicy)
在System.Xml.XmlDownloadManager.GetStream(Uri uri,ICredentials凭据,IWebProxy代理,RequestCachePolicy cachePolicy)
在System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri,字符串角色,类型的ObjectToReturn)
在System.Xml.XmlTextReaderImpl..ctor(String uriStr,XmlReaderSettings设置,XmlParserContext上下文,XmlResolver uriResolver)System.Xml.XmlTextReaderImpl.FinishInitUriString()
在System.Xml.XmlReaderSettings.CreateReader(String inputUri,XmlParserContext inputContext)
在System.Xml.XmlReader.Create(String inputUri,XmlReaderSettings设置,XmlParserContext inputContext)
在System.Xml.XmlReader.Create(String inputUri)我使用与其他HTTPS提要相同的代码(
https://stackoverflow.com/feeds/user/69295
只是为了命名一个),我不会收到错误。 所以这是GitHub提要特有的东西,但是我可以在运行网站的同一台机器上通过浏览器访问它,所以我迷失了方向。关于问题原因的任何想法?
On my ASP.net-based website I am aggregating feeds of my activities from several website. One of those is the GitHub feed at
https://github.com/lucamauri.atom
: this is a valid feed correctly readable using a web browser and it properly worked on my website since a couple of weeks ago. Since then, it started generating errorsIn the code I first create and
XMLReader
and then I load it in aSyndicationFeed
object as follows:Dim TempReader As System.Xml.XmlReader = System.Xml.XmlReader.Create(TempString) Dim SyndFeed As SyndicationFeed = SyndicationFeed.Load(TempReader) Dim TempItems As New List(Of SyndicationItem) TempItems.AddRange(SyndFeed.Items.ToList.GetRange(0, Math.Min(CurrentFeed.TotalElements, SyndFeed.Items.Count)))
This works properly with several feeds, but the GitHub one now generate a TLS error on the first row of the above code:
System.Net.WebException: The request was aborted: Could not create SSL/TLS secure channel.
at System.Net.HttpWebRequest.GetResponse() at System.Xml.XmlDownloadManager.GetNonFileStream(Uri uri, ICredentials credentials, IWebProxy proxy, RequestCachePolicy cachePolicy)
at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials, IWebProxy proxy, RequestCachePolicy cachePolicy)
at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)
at System.Xml.XmlTextReaderImpl.FinishInitUriString() at System.Xml.XmlTextReaderImpl..ctor(String uriStr, XmlReaderSettings settings, XmlParserContext context, XmlResolver uriResolver)
at System.Xml.XmlReaderSettings.CreateReader(String inputUri, XmlParserContext inputContext)
at System.Xml.XmlReader.Create(String inputUri, XmlReaderSettings settings, XmlParserContext inputContext)
at System.Xml.XmlReader.Create(String inputUri)I use the same code with other HTTPS feeds (
https://stackoverflow.com/feeds/user/69295
just to name one) and I do not get the error. So this is something specific to the GitHub feed, but then again I can reach it from a browser on the same machine where I run the website, so I am lost at it.Any idea on the cause of the issue?
原文:https://stackoverflow.com/questions/49093794
最满意答案
结果数组是一个关联数组,索引作为其对应的
item_id
。结果将是
[1]=>array('item_id' => 1, 'title' => 'book', 'date' => '2000'), [2]=>array('item_id' => 2, 'title' => 'car', 'date' => '2000'), [3]=>array('item_id' => 3, 'title' => 'laptop', 'date' => '2001'), ......
The resulting array is an associative array with index as its corresponding
item_id
.So the result will be
[1]=>array('item_id' => 1, 'title' => 'book', 'date' => '2000'), [2]=>array('item_id' => 2, 'title' => 'car', 'date' => '2000'), [3]=>array('item_id' => 3, 'title' => 'laptop', 'date' => '2001'), ......
相关问答
更多-
您可以从函数返回数组,然后在脚本中循环 while($row = $result->fetch_assoc()) { $rows[] = $row; } return $rows; 你可以循环你的脚本 $test = $connectTest->grabResults(test, id, id); foreach($test as $value) { print_r($value); } 在编辑时 如果您需要单独打印它们,您可以按如下方式访问所有带变量名称和范围的元素 $test = ...
-
动态键控每个?(Dynamic Keyed Each?)[2022-08-04]
目前不是 - 有围绕它的讨论: https : //github.com/sveltejs/svelte/issues/703 Not currently — there's a discussion around it though: https://github.com/sveltejs/svelte/issues/703 -
结果数组是一个关联数组,索引作为其对应的item_id 。 结果将是 [1]=>array('item_id' => 1, 'title' => 'book', 'date' => '2000'), [2]=>array('item_id' => 2, 'title' => 'car', 'date' => '2000'), [3]=>array('item_id' => 3, 'title' => 'laptop', 'date' => '2001'), ...... The resulting arr ...
-
如果没有找到MySQL更新行,则首先插入-Preference进行更新(MySQL update row if not found insert -Preference for update first)[2023-08-22]
INSERT ON DUPLICATE KEY UPDATE是要走的路。 它不执行完整插入或如何放置它。 要使此语句起作用,表上必须有主键或唯一键,并且必须在语句中包含相应的列。 在决定是否必须执行插入或更新语句之前,检查所述密钥。 这通常很快。 使用“更新第一”方法,您什么也得不到,不会变得更糟。 无论如何必须完成主键查找。 在最糟糕的情况下,你不得不两次查找主键,浪费了时间。 首先是update语句(可能没有必要),然后是insert语句。 INSERT ON DUPLICATE KEY UPDATE ... -
你的错误是由...造成的 categories = Api.Category |> all |> put_resp_content_type("application/json") |> send_resp(200, categories) 这是分配给类别的单个管道。 因此, send_resp(200, categories)中的send_resp(200, categories)未设置。 为了说清楚,这是编写相同代码的另一种方式: categories = Api.Category |> ...
-
.Net中的键控锁(Keyed Lock in .Net)[2022-05-06]
您正确地认识到您需要确保每个密钥只能创建一个信号量。 标准的习惯用法是: var dict = new ConcurrentDictionary>(); ... var sem = dict.GetOrAdd( , _ => new new Lazy (() => SemaphoreSlim(1, 1))).Value; 可能会创建多个lazies,但只有其中一个会被透露和实现。 除此之外,依赖内存状态是一个值得怀疑的做法。 ... -
在jQuery代码中,修改.post()响应,如下所示: jQuery(document).ready( function($) { $(".ajax-link").click( function() { var data = { action: 'sms_load_conversation', cell_number: $(this).attr('id') }; $.post( 'http://example.com/wp-admin/adm ...
-
从数据库分组结果(Grouping Results from database)[2022-02-10]
您正在为每行返回MySQL返回的每个结果的标题。 因此,无论何时找到“新”类别,您都无法区分。 通过创建像数组这样的临时变量,可以非常简单地完成此操作。 例如: $displayedCategories = array(); while (($row = mysqli_fetch_assoc($result)) != false) { if (!in_array($row['cat_id'], $displayedCategories)) { // This is a new ca ... -
根据文档 - https://developer.android.com/reference/android/support/design/widget/Snackbar.html#make(android.view.View,%20java.lang.CharSequence,%20int) 您将需要父视图,它将作为第一个参数传递给make()方法,因此在Fragment的布局文件中,找出父视图,即RelativeLayout或LinearLayout。 使用view.findViewById()方法获取 ...
-
在控制器中,您可以添加: def craigslist_scrape require 'open-uri' url = "https://losangeles.craigslist.org/search/web" page = Nokogiri::HTML(open(url)) @craigslist_info = page.css("ul.rows") @link_info = page.css("li.result-row p.result-info a. ...