Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ssl 什么是ServicePointManager.ServerCertificateValidationCallback_Ssl_Https_Ssl Certificate_X509certificate - Fatal编程技术网

Ssl 什么是ServicePointManager.ServerCertificateValidationCallback

Ssl 什么是ServicePointManager.ServerCertificateValidationCallback,ssl,https,ssl-certificate,x509certificate,Ssl,Https,Ssl Certificate,X509certificate,我正在我的网站中使用web服务。提供商向我提供了一个示例代码,代码中有这样一行: // For Ignore SSL Error ServicePointManager.ServerCertificateValidationCallback = delegate(object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return true; }; web服务将用户链接

我正在我的网站中使用web服务。提供商向我提供了一个示例代码,代码中有这样一行:

// For Ignore SSL Error
ServicePointManager.ServerCertificateValidationCallback = delegate(object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return true; };
web服务将用户链接到自己的页面,然后返回到我的网站。它使用https

这个代码应用程序是什么?是因为忽略用户web Explorer中的认证错误吗

我认为web服务器站点的认证可能不是有效的认证,或者只是本地认证。我说得对吗


谢谢。

认为它仅用于绕过无效的SSL证书是常见的错误。但是,许多人使用此回调仅忽略无效证书

此回调提供附加SSL证书和访问信息检查的能力,否则无法访问。例如,只有在此回调中,才能获得无法从外部处理的特定证书错误:名称匹配/不匹配(它们存储在
sslPolicyErrors
参数中。此外,
chain
参数包含服务器发送的确切证书链。当系统存储缺少中间CA证书时,此对象可用于构造证书链

例如,当您从Thawte(或其他提供商)购买证书时,其证书没有“certificate Authority Issuer”访问方法,并且系统存储中未安装中间证书。在这种情况下,您将无法为该证书构建链。但是,web浏览器不会投诉,因为缺少(在客户端上)证书是通过web服务器的SSL握手发送的。而此回调是访问证书的唯一方法


我不会在生产环境中绕过SSL错误,因为它会打开安全漏洞。

它用于绕过无效的SSL证书。