I have this scenario: I have an ASP.NET API which is deployed on IIS under the default web site. I have added the API by right click on default web site -> add application. API is working fine and I am able to use it.
I am using this API in my ASP.NET MVC project. On local, everything is working fine. Then I deployed it to the same IIS where the API is deployed. I have created a new application under the same default web site. Now ASP.NET MVC is unable to communicate with the API.
I'm getting errors like this:
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
Then I changed the API hostname reference in the ASP.NET MVC app to IP, localhost. In that case I am getting this response:
The SSL connection could not be established, see inner exception. System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure
Am I missing anything? How to solve this?
Thanks