1

I am using rest-api (I built the server as ASP.NET and the client as explained here: https://www.codeprojeAt.com/Tips/497123/How-to-make-REST-requests-with-Csharp) And I want to use ssl during my development. For some reason when I use the "iis express development certificate" I still get this error: System.Net.WebException: 'The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.' AuthenticationException: The remote certificate is invalid according to the validation procedure.

Any ideas..?

Nevo Mashiach
  • 95
  • 2
  • 6

1 Answers1

2

If you are using a self-signed development certificate, a typical web client will not be able to validate it, because it was not created by a certificate authority that maps back to a root authority. You have two choices:

  1. In your web client, disable validation of the chain of trust.

  2. Install the self-signed cert as a root cert on the machine running the web client. Not all certs can be installed this way, so you may actually have to generate a development root cert, use it to generate your site's development cert, then install the development root cert.

John Wu
  • 50,556
  • 8
  • 44
  • 80
  • Can you please be more specific in option 2? – Nevo Mashiach Jun 19 '17 at 20:06
  • 2
    Read [this blog](https://blogs.msdn.microsoft.com/robert_mcmurray/2013/11/15/how-to-trust-the-iis-express-self-signed-certificate/), which contains step by step instructions and screen shots. – John Wu Jun 19 '17 at 20:21