解决Could not establish trust relationship for the SSL/TLS secure channel with authority问题

问题:

    今天部署到iis服务器发现调用某个API老是出现错误,查看自己写的日志发现打印出Could not establish trust relationship for the SSL/TLS secure channel with authority 这个错误

解决:

    在请求之前,加上以下代码即可忽略证书问题

    ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, errors) => true;

你可能感兴趣的:(解决Could not establish trust relationship for the SSL/TLS secure channel with authority问题)