FeedReader icon indicating copy to clipboard operation
FeedReader copied to clipboard

errror with SSL/TLS

Open MikeCoderr opened this issue 4 years ago • 0 comments

Dear Team,

I got V 1.2.1 installed. Working fine with other RSS feeds. When using this on this specific feed: var feed = CodeHollow.FeedReader.FeedReader.Read("https://www.hkex.com.hk/Services/RSS-Feeds/News-Releases?sc_lang=en");

I get diverse error messages depending on which computer / Visual Studio version I use it from., ranging from something sort of SSL/TLS error (similar to this: https://stackoverflow.com/questions/41748946/paypal-api-httpwebrequest-throws-ssl-webexception) and for VS 2019 I get this message: CodeHollow.FeedReader.Parser.FeedTypeNotSupportedException: 'unknown feed type html'

Any idea on how to fix this? Can you replicate?

Thanks Mike

If I use below, it parses fine: CodeHollow.FeedReader.Feed feed; var rssFeedContent = MakeRequest("https://www.hkex.com.hk/Services/RSS-Feeds/News-Releases?sc_lang=en"); if (!rssFeedContent.Contains("MakeRequest")) { feed = CodeHollow.FeedReader.FeedReader.ReadFromString(rssFeedContent); exchangeNewsCheckerHKEX.AnlyzeTheFeed(feed); }

with MakeRequest like this: private static string MakeRequest(string url) { string result = "error in MakeRequest"; try {//https://stackoverflow.com/questions/2859790/the-request-was-aborted-could-not-create-ssl-tls-secure-channel ServicePointManager.Expect100Continue = true; ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12 //| SecurityProtocolType.Ssl3 ; HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); using (HttpWebResponse resp = (HttpWebResponse)request.GetResponse()) { Stream stream = resp.GetResponseStream(); StreamReader reader = new StreamReader(stream); result = reader.ReadToEnd(); resp.Close(); } } catch (Exception ex) { Logger.Error("Error in : MakeRequest:" + ex); } return result; }

MikeCoderr avatar Sep 06 '19 06:09 MikeCoderr