Wednesday, April 8, 2015

The remote certificate is invalid according to the validation procedure

I recently set up a web application to use SSL.  It was a 2-tier ASP.NET MVC Web Application that connected to an ASP.NET Web API backend.

So, as soon as I logged into my Web Application, I noticed that I was not getting any data loaded on the screen!

Well, thanks to the handy dandy Console of Firebug, I was able to see this JavaScript error message:

Error Message: System.AggregateException: One or more errors occurred. ---> System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.

Well, I was using a Self Signed SSL Certificate, so I figured that this would be the cause of this problem.  The first place I looked was this article: http://blogs.msdn.com/b/jpsanders/archive/2009/09/16/troubleshooting-asp-net-the-remote-certificate-is-invalid-according-to-the-validation-procedure.aspx

Based on the recommendation in the article, it mentioned that I should install my Self Signed SSL Certificate into the Trusted Root Certification Authorities store.

However, when I went to view my SSL certificate, I did not see the same dialog that was presented in the MSDN article:





Therefore, I had to click on the Details tab and select "Copy to File" to export the SSL certificate:











Of course, once I had exported the SSL certificate, I had to go ahead and import the SSL certificate back into the Trusted Root Certificate Authorities Store:










As you can probably guess, after doing that and refreshing my ASP.NET MVC Web Application, the error message went away!!




No comments:

Post a Comment