I have created an aditional IP in order to host 2 Sites and set up an HTTPS Binding for them. I've set the binding where each uses 1 IP and both are set to 443 and their own certificate.
Once I've reseted the sites everything worked fine. Both open in https are there no certificate issues. The problem I'm facing is when those sites call a second server. Then I get errors like:
This happenes for both Sites. I've checked the Host file the second server and both IP's are added there. Once I've changed 1 of the sites back from the specific IP to All Unassigned then that Site worked fine again. But the second site that still has the specific IP does not work in that regard. I can't have both set to all Unassigned and it's confusing me why setting it to that ,when it still uses that IP anyway ,makes it not work.
A while ago only 1 was https and the other http and then it all worked fine. Now that I've tried making both HTTPS I started having issues with contacting second server. Both of the servers support TLS1.2 , 1.1 and 1.0 At the begging I've disabled 1.1 but tried enabling it to see if thats the issue. I've also tried some suggestions online like adding these lines before making a call to the server:
"System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };"
To test if it's the certificate issue and I've also tried setting TLS1.2 here and updated the project to use .net4.6
Any advices would be appreciated
EDIT:
I've created the test on the actual server and the error is the same: Test Code
For some reason I can't choose .Net4.6 even when I click on Install other frameworks the Target Framework is always the same.
I fixed the problem. The issue was with the Host file , but not the one from the server I'm trying to call , but the actual localhost. The domain was using local IP 127.0.0.1 the same as what my other domain was using since it's set to "All Unassinged". Then calling the server as the domain would actually return wrong cert and that would break it.
I just changed the IP for both domains from local IP to a specific Private IP and it worked.
Thanks for help jdweng and Jokies Ding!