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

  • SEARCH
  • Home
  • 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 3636242
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:00:23+00:00 2026-05-19T01:00:23+00:00

I have a piece of .NET code that is erroring out when it makes

  • 0

I have a piece of .NET code that is erroring out when it makes a call to HTTPWebRequest.GetRequestStream. Here is the error message:

The underlying connection was closed:
Could not establish trust relationship
for the SSL/TLS secure channel.

I’ve read a few things that suggest that I might need a certificate on the machine running the code, but I believe I have all the require certificates…

This is how I checked to see if I had the required certificates:

  1. hit the webservice using Firefox.
  2. Look at the certificates being used
    to hit that web service by looking
    at the security info through the
    browser
  3. export the certificates
  4. import the certificates through
    Internet Options in the control panel

Should this be sufficient? I am still getting the error.

Code:

        var request = (HttpWebRequest)HttpWebRequest.Create(requestUrl); //my url
        request.Method = StringUtilities.ConvertToString(httpMethod); // Set the http method GET, POST, etc.

        if (postData != null)
        {
            request.ContentLength = postData.Length;
            request.ContentType = contentType;
            using (var dataStream = request.GetRequestStream())
            {
                dataStream.Write(postData, 0, postData.Length);
            }
        }

UPDATE:

Adding some screen shots of my certs. Let me know if anything looks wrong:

First, we have the cert that Firefox is using:

enter image description here

Next, we have what is in my Trusted Root Certs according to the MMC:

enter image description here

Last, we have what is in my Intermediate certs according to the MMC:

enter image description here

Does this look right?

  • 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-05-19T01:00:24+00:00Added an answer on May 19, 2026 at 1:00 am

    If the 3rd party webservice is secured using a self signed certificate, you will need to install their CA signing certificate into your trusted certificates keystore

    EDIT based on code sample.

    I’ve tried an example calling those facebook urls without problem doing an http get to one of the graph.facebook urls without error using the code sample below. Please can you update your example with what you’re trying to post and to which URL?

    At the moment from what I can see from mine, it seems to work, so can only assume a certificate problem on the pc your’re executing it from still.

        {
            string requestUrl = "https://graph.facebook.com/btaylor";
    
            var request = (HttpWebRequest)HttpWebRequest.Create(requestUrl); //my url
            request.Method = "GET";
    
            WebResponse response = request.GetResponse();
    
            Stream responseStream = response.GetResponseStream();
            // TODO: Do whatever you need with the response
            Byte[] myData = ReadFully(responseStream);
            string s = System.Text.ASCIIEncoding.ASCII.GetString(myData);
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a project that adds elements to an AutoCad drawing. I noticed that
I have a script that appends some rows to a table. One of the
I have a new web app that is packaged as a WAR as part
I have several USB mass storage flash drives connected to a Ubuntu Linux computer
I have a snippet to create a 'Like' button for our news site: <iframe
I have found this example on StackOverflow: var people = new List<Person> { new
I have a login.jsp page which contains a login form. Once logged in the
i have a input tag which is non editable, but some times i need
Let say I have the following desire, to simplify the IConvertible's to allow me
I want to have generalised email templates. Currently I have multiple email templates with

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.