reading SSL page with CURL (php)

后端 未结 7 1901
南方客
南方客 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:40

    If you want to use SSL peer verification (turning it off is not always good idea) you may use next solution on Windows globally for all applications:

    1. Download file with root certificates from here: http://curl.haxx.se/docs/caextract.html
    2. Add to php.ini:

    curl.cainfo=C:/path/to/cacert.pem

    that's all magic, CURL can now verify certificates.

    (as I know there is no such problem on Linux, at least on Ubuntu)

提交回复
热议问题