解决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月26日 18:01 - Inozemcevabode  
http://bit.ly/37s3dPW - help with dissertation Reach Your Goals with Our Help Custom paper writing services by a reliable company always on-time, entirely plagiarism-free, fully confidential http://bit.ly/2tpE9u7 - dissertation writing For partners http://bit.ly/2Qebt05 [url=http://www.piribauer.cc/guestbook/index.php?&mots_search=&lang=&skin=&test=&ok_post=1]Help write an essay[/url] [url=http://laquar.com.au/monochrome-magic/?attributes=eyIxMDUxOSI6Ik1lc3NhZ2Ugb24gZnJvbnQgb2YgY2FyZCAoc2hvcnQgaXMgYmVzdCkiLCIxMDUyMCI6Imh0dHA6XC9cL2JpdC5seVwvMzdzM2RQVyAtIGhlbHAgd2l0aCBjb2xsZWdlIGVzc2F5ICBcclxuTmVlZCBoZWxwIHdpdGggeW91ciBhc3NpZ25tZW50PyBcclxuR2V0IGFuIGV4cGVydCBhY2FkZW1pYyB3cml0aW5nIGFzc2lzdGFuY2UhIFdlIGNhbiB3cml0ZSBhbnkgcGFwZXIgb24gYW55IHN1YmplY3Qgd2l0aGluIHRoZSB0aWdodGVzdCBkZWFkbGluZS4gXHJcbmh0dHA6XC9cL2JpdC5seVwvMzdzM2RQVyAtIHRoZXNpcyBwYXBlciB3cml0aW5nIFxyXG4gXHJcbiBcclxuRm9yIHBhcnRuZXJzICBodHRwOlwvXC9iaXQubHlcLzJRZWJ0MDUgXHJcbiBcclxuW3VybD1odHRwOlwvXC93d3cucGVuLWFscy1sb3RnZW5vb3QubmxcL2luZGV4LnBocD9wYWdlPWdhc3RlbmJvZWtcL11Qcm9mZXNzaW9uYWwgZGlzc2VydGF0aW9uIGhlbHBbXC91cmxdIFt1cmw9aHR0cDpcL1wvZGptYXJreXAuY29tXC9ndWVzdGJvb2sucGhwXURvIG15IGNvdXJzZXdvcmsgb25saW5lW1wvdXJsXSBbdXJsPWh0dHA6XC9cL3VuaXZlcnNhbHRyYXZlbC5jb20udG5cL3B1cmUtbHV4ZS1pbi1wdW50YS1taXRhXC8jY29tbWVudC0zMTddV3JpdGluZyBzZXJ2aWNlcyBueWNbXC91cmxdICAzMGEwZjkzICIsIjEwODMxIjoiIn0]Fast custom essays[/url] [url=http://hokkaido.s19.xrea.com/kumachat/index.html]Buy research paper[/url] 66698d8
回复
2020年1月26日 05:21 - Gilbertcon  
Accounts are ALL made in 2011 - 2014 ! They are HIGH Quality accounts and 100% secure (They come with OGE) - Mail Access included What are these used for? Growing, Claiming, Botting - These accounts are more likely to hit explore & will grow faster! 1 Account is $4 https://sellaccs.net Skype & Telegram : congmmo ICQ : @652720497 Email : congmmo@gmail . com
回复
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
回复