PHP CURL CURLOPT_SSL_VERIFYPEER ignored

前端 未结 2 473
伪装坚强ぢ
伪装坚强ぢ 2020-11-28 04:35

For some reason I am unable to use CURL with HTTPS. Everything was working fine untill I ran upgrade of curl libraries. Now I am experiencing this response when trying to pe

2条回答
  •  误落风尘
    2020-11-28 04:52

    According to documentation: to verify host or peer certificate you need to specify alternate certificates with the CURLOPT_CAINFO option or a certificate directory can be specified with the CURLOPT_CAPATH option.

    Also look at CURLOPT_SSL_VERIFYHOST:

    • 1 to check the existence of a common name in the SSL peer certificate.
    • 2 to check the existence of a common name and also verify that it matches the hostname provided.

    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
    

提交回复
热议问题