Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7751967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:41:03+00:00 2026-06-01T11:41:03+00:00

I need to be able to read xml/rss from a https web site in

  • 0

I need to be able to read xml/rss from a https web site in a console program.

until now my program supports plain http, and i’ve been searching around but i cant seem to find an easy way to implement support for https.
It would not matter if the site has a valid certificate or not, but i would appriciate to get hints towards how i would check these certificates to.

I might not know too much about this so any hints are appriciated!

what i currently do for http is:

XmlTextReader rssReader;
XmlDocument rssDoc;
rssReader = new XmlTextReader(url);
rssDoc = new XmlDocument();
rssDoc.Load(rssReader);

When trying this on a site without a trusted certificate i get an error stating:
“The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.”

string url = "https://somesite.com";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream resStream = response.GetResponseStream();

My program needs to support both trusted and untrusted https sites.

Program is running on a server, and hence has to handle the untrusted https sites in code.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T11:41:05+00:00Added an answer on June 1, 2026 at 11:41 am

    For the certificate issue try the following…

    ServicePointManager.ServerCertificateValidationCallback += new System.Net.Security.RemoteCertificateValidationCallback((s, ce, ch, ssl) => true);
    

    …somewhere at the start – or before doing the request.

    That’s basically validating any certificate unconditionally, a bit simplified.

    EDIT: that’s ‘to blindly’ trust (and is of global character for your app) – proper implementation would handle the parameters – or entails implementing ICertificatePolicy to specifically deal with different hosts/certificates.

    EDIT (certificates): as to how the certificates and SSL actually work – and related to the above (based on the comments/discussion)…

    http://www.verisign.com/ssl/ssl-information-center/how-ssl-security-works/index.html
    How does SSL really work?
    https://superuser.com/questions/84572/public-key-encryption

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to be able to read the value of my attribute from within
I need to be able to read from a dropdown box on a page
Hi I am trying to read an xml file from outside the web-app container,
I'm using SimpleXML for parsing XMl documents. I need to be able to read/update
I have some XML and need to be able to read the data within.
I need to be able to read a list of variables that follow certain
I need to be able to read the contents of a Mysql database 10
I need to get key/value pairs from XML to populate member info on a
I've setup awstats to read cloudfront log files and I need to be able
I want to read a response from a non-wsdl web service call using JAXB.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.