PHP - SSL certificate error: unable to get local issuer certificate

前端 未结 16 2806
时光取名叫无心
时光取名叫无心 2020-11-21 07:49

I\'m running PHP Version 5.6.3 as part of XAMPP on Windows 7.

When I try to use the Mandrill API, I\'m getting the following error:

Uncaught e

16条回答
  •  星月不相逢
    2020-11-21 08:18

    Thanks @Mladen Janjetovic,

    Your suggestion worked for me in mac with ampps installed.

    Copied: http://curl.haxx.se/ca/cacert.pem

    To: /Applications/AMPPS/extra/etc/openssl/certs/cacert.pem

    And updated php.ini with that path and restarted Apache:

    [curl]
    ; A default value for the CURLOPT_CAINFO option. This is required to be an
    ; absolute path.
    curl.cainfo="/Applications/AMPPS/extra/etc/openssl/certs/cacert.pem"
    openssl.cafile="/Applications/AMPPS/extra/etc/openssl/certs/cacert.pem"
    

    And applied same setting in windows AMPPS installation and it worked perfectly in it too.

    [curl]
    ; A default value for the CURLOPT_CAINFO option. This is required to be an
    ; absolute path.
    curl.cainfo="C:/Ampps/php/extras/ssl/cacert.pem"
    openssl.cafile="C:/Ampps/php/extras/ssl/cacert.pem"
    

    : Same for wamp.

    [curl]
    ; A default value for the CURLOPT_CAINFO option. This is required to be an
    ; absolute path.
    curl.cainfo="C:/wamp/bin/php/php5.6.16/extras/ssl/cacert.pem"
    openssl.cafile="C:/wamp/bin/php/php5.6.16/extras/ssl/cacert.pem"
    

    If you are looking for generating new SSL certificate using SAN for localhost, steps on this post worked for me on Centos 7 / Vagrant / Chrome Browser.

提交回复
热议问题