reading SSL page with CURL (php)

后端 未结 7 1883
南方客
南方客 2020-12-05 00:24

I am trying to download the content of a secure (uses https) webpage using php and curl libraries.

However, reading failed and I get error 60: \"SSL certificate prob

7条回答
  •  一生所求
    2020-12-05 00:49

    It sounds like you might be misinterpreting the error. It looks to me like the site you're connecting to is self-signed or some other common problem. Just like the usual browser warning, you're easiest work around is to disable the checks.

    You'll need to set CURLOPT_SSL_VERIFYPEER and CURLOPT_SSL_VERIFYHOST to FALSE. This should disable the two main checks. They may not both be required, but this should at least get you going.

    To be clear, this disables a feature designed to protect you. Only do this if you have verified the certificate and server by some other means.

    More info on the PHP site: curl_setopt()

提交回复
热议问题