Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

errror with SSL/TLS #29

Open
MikeCoderr opened this issue Sep 6, 2019 · 0 comments
Open

errror with SSL/TLS #29

MikeCoderr opened this issue Sep 6, 2019 · 0 comments

Comments

@MikeCoderr
Copy link

MikeCoderr commented Sep 6, 2019

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; }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant