解决php 使用curl调用https地址时报错“SSL Certificate Problem: Unable to get Local Issuer Certificate”

解决php 使用curl调用https地址时报错“SSL Certificate Problem: Unable to get Local Issuer Certificate”

解决异常SSL/TLS错误的提示-“SSL Certificate Problem: Unable to get Local Issuer Certificate”

在执行对安全HTTPS目标的cURL请求时,您是否曾收到消息“SSL certificate problem:unable to get local issuer certificate?”?”

您是否一直收到相同的“SSL Certificate Problem: Unable to get Local Issuer Certificate”消息,无论您如何更改cURL请求或验证URL?

在本文中,我们将给出此错误的主要原因,并向您展示如何修复“SSL证书问题:无法获取本地颁发者证书”错误。

SSL证书问题的原因:无法获取本地颁发者证书

在某些情况下,当您使用客户端SSL证书时,当您向安全的HTTPS源发出请求时,必须共享SSL证书来验证您的身份。因此,如果遇到“SSL Certificate Problem: Unable to get Local Issuer Certificate”错误,则表示系统上的根证书工作不正常。

SSL证书问题的解决方案:Unable to get Local Issuer Certificate

对于“SSL certificate problem: unable to get local issuer certificate”错误,您有三个主要解决方案。

  • 修改 php.ini
    • Go to http://curl.haxx.se/ca/cacert.pem and download cacert.pem.
    • Copy cacert.pem to your version of openssl/zend, such as ‘/usr/local/openssl-0.9.8/certs/cacert.pem’.
    • In your php.ini file, modify the CURL configuration by adding “cainfo = ‘/usr/local/openssl-0.9.8/certs/cacert.pem’”
    • Restart PHP and see if CURL is able to read HTTPS URL now.
  • Don’t Change php.ini (Maintain SSL)

Enter the following code:

$ch = curl_init();
$certificate_location = ‘/usr/local/openssl-0.9.8/certs/cacert.pem’;
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, $certificate_location);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $certificate_location);
  • Disable SSL (Not Recommended)
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

Required for comment verification
2020年1月15日 01:20 - mallorygb3  
New super hot photo galleries, daily updated collections http://matureshemale.durbanshemale.miaxxx.com/?ariel cluck porn mlay porn viking of porn male teenage gay porn porn sounding
回复
2020年1月14日 16:30 - pedromt11  
New super hot photo galleries, daily updated collections http://antporn.bloglag.com/?myra thick amature porn anal toy porn free 1980s free porn movies hiring young gay men for porn unko porn
回复
2020年1月9日 19:09 - anastasiahb69  
Sexy pictures each day http://shemalematch.liveshemale.jsutandy.com/?jena porn on motorcycles danger dave au porn hippie sex porn porn videos that degrade the viewer german vintage gay porn
回复