I am using .Net Webapi 2 and i am getting the following error during call another web service with 'Https'.
Could not establish trust relationship for the SSL/TLS secure channel
and i also found temporary solution. with adding this line of code before executing httpwebresponse
ServicePointManager
.ServerCertificateValidationCallback =
RemoveCertificateValidationCallback (delegate { return true; });
first of all i dont have idea what that code mean but at least that code work and i am succed hit Https web service. But that code is detected in veracode scan and it gots medium flaws security issue.
veracode documentation says: that i have to monitor wether certificate is expire or not. because it can make exception.
the question is. is there any solution for me to call https web service from server ? without using that code ? or do i have to install certificate and do i have to configure something in iis for calling https web service from server side / backend ?