Error: SSL peer certificate or SSH remote key was

Error: SSL peer certificate or SSH remote key was not OK (CURLE_SSL_PEER_CERTIFICATE): SSL certificate problem: unable to get local issuer certificate


Environment

  • wamp64 3.2.3

  • php7.3

  • PHP Curl Class

Issue

Getting an error "Error: SSL peer certificate or SSH remote key was not OK (CURLE_SSL_PEER_CERTIFICATE): SSL certificate problem: unable to get local issuer certificate"

        $host = $this->daletou.$qishu;
        $host = "https://www.baidu.com";

        $curl = new Curl();
        $curl->setUserAgent('Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/109.0');
        $curl->setOpt(CURLOPT_SSL_VERIFYPEER,0);//that is the key!
        $curl->get($host);

Resolution

不检查证书即可:CURLOPT_SSL_VERIFYPEER = 0 ;CURLOPT_SSL_HOST= 0;


<<上一篇:世上本无事,庸人自扰之
本文发表于2024-03-27 10:03:03 阅读2935次
>>下一篇:那谁有句话,群众的眼都是瞎的

验证码: recode
姓 名(必须填写)
email(必须填写)