error setting certificate verify locations: CAfile: /etc/pki/tls/certs/ca-bundle.crt
•
Ditulis oleh Tim Pasti Oke
Open terminal ctrl+alt+t and change working directory:
cd /etc/ssl/certs/
Download pem file in the certs folder
sudo wget https://curl.se/ca/cacert.pem
Now open the file .curlrc
nano ~/.curlrc
Add the below lines in the open file
capath=/etc/ssl/certs/
cacert=/etc/ssl/certs/ca-certificates.crt
Now save the file and do your things using curl command.
This works for me. Just making a symbolic link ln -s /etc/ssl/certs/ca-certificates.crt /etc/pki/tls/certs/ca-bundle.crt
how to detect curl error
curl_setopt($ch, CURLOPT_FAILONERROR, true) //
$result = curl_exec($ch)
if (curl_errno($ch)) {
$error_msg = curl_error($ch)
echo $error_msg
}
or the worst method
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true)
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false)
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false)
Butuh solusi instan siap pakai?
Dapatkan modul & script server production-ready langsung di web store kami.
Komentar
Belum ada komentar. Jadilah yang pertama memberikan komentar!