且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

cURL登录到HTTPS站点

更新时间:2022-04-16 02:55:11



  1. 将其上传到脚本可以看到的位置。

  2. 然后添加:

  1. Export the certificate.
  2. Upload it to where your script can see it.
  3. Then add:

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_CAINFO, getcwd() . "/path/to/certificateCA.crt");