AWS HTTP error: cURL error 60: SSL certificate problem: unable to get local issuer certificate

Skip to content

  • I moved my blog’s hosting from iPage to and AWS EC2 but I cannot connect to Jetpack due to this error:

    cURL error 60: SSL certificate problem: unable to get local issuer certificate

    I have updated my php.ini file to point to a cacert.pem file that I downloaded from
    https://curl.haxx.se/docs/caextract.htm

    curl.cainfo=”/home/ec2-user/cacert.pem”
    openssl.cafile=”/home/ec2-user/cacert.pem”

    Any clue on this? I followed Amazon’s instructions for setting up the EC2 for WordPress and for setting up SSL.

    Also, last night the problem went away temporarily but came back this morning…

    Bobby

    The page I need help with: [log in to see the link]

  • The topic ‘cURL error 60: SSL certificate problem: unable to get local issuer certificate’ is closed to new replies.

나의 php개발자 성장기

Laravel/라라벨정보

cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)

php개발자가 되고싶은 병아리 2020. 4. 3. 15:29

 https://curl.haxx.se/ca/cacert.pem

불러오는 중입니다...

여기서 cacert.pem파일 받아서 c드라이브 걍 넣고

php.ini에 crul검색하면

[curl]
; A default value for the CURLOPT_CAINFO option. This is required to be an
; absolute path.
curl.cainfo = "C:\cacert.pem"

주석풀고 이렇게 추가한다음 웹 서버 재시작 하면 된다고 한다

(주의사항 php.ini 수정할때 php스톰에디터 같은걸로 수정하셈 이상한 에디터로 했다가 오류남 ㅜ)

실패 :

laravel cURL error 77 : 뜨면 php.ini에서 curl에 인증서 경로가 잘못됬다는거임.

자 인증서 경로가 정확한데 왜 경로가 잘못됬따고 하는걸까 

일딴 웹서버는 valet nignx인데 윈도우에서 servie 들어가서 

valet_phpfpm 과 valet_nignx 를 둘다 재시작 했었는데 77오류가 떳다

이거 안되서 짜증나서 그냥 valet uninstall 하고 valet install로 다시 깔았더니 됬다!!!

그러나 다시 오류발생 ㅜㅜ

일딴 내 컨트롤러 소스

public function index()
{
$popularMovies = Http::get('https://api.themoviedb.org/3/movie/popular')->$json();
dd($popularMovies);

return view('index');
}

오류메시지 : Undefined variable: json

흠... 저기서 요청한값을 json으로 받겠다 같은데 왜 안되지

하 난 진짜 병신이다 $json이뭐냐 -.-;;; json()이잖아....

o/s 윈도우10
라라벨 버전 7
php버전 7.3

I was getting the same error If you want to use http then you can use below solution:

Error executing "PutObject" on "https://s3-ap-southeast-2.amazonaws.com/mybucketname/TestBanner1_e1d8d74e41"; AWS HTTP error: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

I have resolved it by using http method this is not secure to use secure way enter _ curl.cainfo = "/path/to/file.cacert.pem"_ in php.ini file :

Solution:

'options' => ['scheme' => 'http',],

Complete Example code:

// ...'s3bucket' => ['class' => \frostealth\yii2\aws\s3\Storage::className(),'region' => 'ap-southeast-2','credentials' => [ // Aws\Credentials\CredentialsInterface|array|callable'key' => 'JGUTEHCDE.............OSHS','secret' => 'SJEUC-----------jzy1-----rrT',],'bucket' => 'yours3bucket',//'cdnHostname' => 'http://example.cloudfront.net','defaultAcl' => \frostealth\yii2\aws\s3\Storage::ACL_PUBLIC_READ,'debug' => false, // bool|array'options' => ['scheme' => 'http',],],// ...


I am trying to connect Amazon's S3 files from my (localhost) Windows 8 machine running AppServ 2.5.10 (which includes Apache 2.2.8, php 5.2.6, mysql 5.0.51b and phpMyAdmin 2.10.3) using Amazon SDK for php.

In order to be compatible with Amazon SDK's namespace feature, I replaced php with version 5.3.28 by downloading its zipped file and unzipped it.

My php code works fine to access S3 file in Amazon EC2 but it failed in my Windows local host.

However when I run the php srcipt to read Amazon S3 bucket file in Windows local host machine, I got SSL error as following:


Fatal error: Uncaught exception 'Guzzle\Http\Exception\CurlException'
with message '[curl] 60: SSL certificate problem: unable to get local
issuer certificate [url]
https://images-st.s3.amazonaws.com/us/123977_sale_red_car.png' in
C:\AppServ\www\ecity\vendor\guzzle\guzzle\src\Guzzle\Http\Curl\CurlMulti.php:342
Stack trace:

#0
C:\AppServ\www\ecity\vendor\guzzle\guzzle\src\Guzzle\Http\Curl\CurlMulti.php(283):
Guzzle\Http\Curl\CurlMulti->isCurlException(Object(Guzzle\Http\Message\Request),
Object(Guzzle\Http\Curl\CurlHandle), Array)

#1
C:\AppServ\www\ecity\vendor\guzzle\guzzle\src\Guzzle\Http\Curl\CurlMulti.php(248):
Guzzle\Http\Curl\CurlMulti->processResponse(Object(Guzzle\Http\Message\Request),
Object(Guzzle\Http\Curl\CurlHandle), Array)

#2
C:\AppServ\www\ecity\vendor\guzzle\guzzle\src\Guzzle\Http\Curl\CurlMulti.php(231):
Guzzle\Http\Curl\CurlMulti->processMessages()

#3
C:\AppServ\www\ecity\vendor\guzzle\guzzle\src\Guzzle\Http\Curl\CurlMulti.php(215):
Guzzle\Http\Curl\CurlMulti->executeHandles()

#4
C:\AppServ\www\ecity\ven in
C:\AppServ\www\ecity\vendor\aws\aws-sdk-php\src\Aws\Common\Client\AbstractClient.php
on line 288


I download the certifate from http://curl.haxx.se/ca/cacert.pem and define it in php.ini as following:


curl.cainfo = "C:\AppServ\cacert.pem"

but I still got the same error. It seems php doesn't honor the curl.cainfo defined in php.ini.

My php version is 5.3.28 according to localhost/phpinfo.php.

I also checked the cainfo parameter to be correct as C:\AppServ\cacert.pem using


echo ini_get( "curl.cainfo" ) ;

in the php script.

Php version higher than 5.3 shall support curl.cainfo in php.ini.

In Windows' command line, I check curl behavior and it seems work fine.


C:\Users\Jordan>curl https://s3-us-west-2.amazonaws.com/images-st/aaa.txt
curl: (60) SSL certificate problem: unable to get local issuer certificate
......
C:\Users\Jordan>curl --cacert C:\AppServ\cacert.crt https://s3-us-west-2.amazonaws.com/images-st/aaa.txt
This is aaa.txt file.
Stored in Amazon S3 bucket.

Is it because I used Apache in Windows which doesn't match php 5.3.28 zip file I downloaded from http://windows.php.net/download/ VC9 x86 Thread Safe (2014-Jun-11 01:09:56) zip version.

In my apache's httpd-ssl.conf file, I have the following setting even I use from local host in Windows 8.


<VirtualHost _default_:443>
DocumentRoot "C:/AppServ/www"
ServerName localhost:443
ServerAdmin [email protected]
ErrorLog "C:/AppServ/Apache2.2/logs/error.log"
TransferLog "C:/AppServ/Apache2.2/logs/access.log"
SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile "C:/AppServ/Apache2.2/conf/mydomain.cert"
SSLCertificateKeyFile "C:/AppServ/Apache2.2/conf/mydomain.key"
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory "C:/Apache2.2/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
BrowserMatch ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog "C:/AppServ/Apache2.2/logs/ssl_request.log" \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>

Now I am wondering what is the problem and how to connect to Amazon S3 bucket files and RDS database without producing these curl cannot get local issuer certificate problems from my Windows 8 local host.

Any advice?


How do I fix curl 60 SSL certificate problem certificate has expired?

The only solution to this problem is to get your host to update the root certificate on your server. So, you need to contact your server host and ask them to insert a new cacert. pem file into their servers, and configure it within their php.

How do you fix a curl Error 60?

Solution:.
Save the cacert. pem file anywhere on your system. Example: Since you're modifying both php. ... .
Open your php.ini file. If your php.ini file doesn't have the curl.cainfo line, just add it to the end of the file, then add the file path where you saved your cacert.pem file: ... .
Restart your server..

What is a curl Error 60?

Error “curl: (60) SSL certificate problem: unable to get local issuer certificate” can be seen when the SSL certificate on the server is not verified or properly configured.

How install Cacert pem in php INI?

2 Answers.
Edit the /etc/ssl/certs/cacert. pem file, and add your new CA public key to the bottom..
Edit php. ini and add the line openssl. cafile=/etc/ssl/certs/cacert. pem to the top (or bottom)..
Restart the webserver..