Skip navigation

Could Not Establish Trust Relationship with Remote Server.

Suppose you're building web services and you want to secure them using SSL. If you're using MS Certificate Server you could create your own certificate or request a trial certificate from one of the Certificate companies (for example, Verisign or Thawte). When accessing the web service through code the error message 'The underlying connection was closed: Could not establish trust relationship with remote server.' appears. This can be solved in code by adjusting the default Certificate policy and making sure it accepts any certificate (in this case even from an untrusted company). This will help you test your web services. The code shows an example.

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.