Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

MahmoudAdelAli's avatar

Error setting certificate verify locations

Hi , i using hetzner cloude SDK package

 LKDevelopment /hetzner-cloud-php-sdk  # at github

and when i go production i got error

Error setting certificate verify locations: CAfile: /etc/pki/tls/certs/ca-bundle.crt CApath: none for "https://api.hetzner.cloud/v1/images".

i installed the certificate and also from root i moved the domain.com.crt to ca-bundle like i fount at search , but even that not solved the problem , so there's anyway to skip this validate or something like that ? cause i explored all package file and there's no option to stop that and this is curl request that package send from debug

curl "https://monstersgate.com/dashboard/ds-servers/list-ds-servers" \
   -X GET \
   -H 'host: monstersgate.com' \
   -H 'te: trailers' \
   -H 'sec-fetch-user: ?1' \
   -H 'sec-fetch-site: none' \
   -H 'sec-fetch-mode: navigate' \
   -H 'sec-fetch-dest: document' \
   -H 'upgrade-insecure-requests: 1' \
   -H 'cookie: XSRF-TOKEN= I REMOVED IT ; laravel_session=eyJpdiI6InJXWU5UVGtNczg3eTZpY1pVb0l0dWc9PSIsInZhbHVlIjoiT2ZsOEdKZ2hoVmJrMCtTdmNxUVBQSWkvei9pdlpTWitQbzdabDJ1RFpKZmRaZ3MrSjJLdDkvcHhNKy9SWXFZakxOMFE2QWR6NElRZFhIdE9TMzBWRGVlL3UrMURNcmFOd0U1Qlo1bzJHYU1sbG1TZTEzbDcrbjZUSlVQdkhvOVUiLCJtYWMiOiI1Yzc5OWQxY2I3YWUzYTdkM2RlMmY2M2MxMjFkNWEyNjA4YmY4OTJhZWJlMDFlMTViNjVjM2MwNjRkNmQwYTMzIiwidGFnIjoiIn0%3D' \
   -H 'accept-encoding: gzip, deflate, br' \
   -H 'accept-language: en-US,en;q=0.5' \
   -H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8' \
   -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/113.0';
0 likes
2 replies
LaryAI's avatar
Level 58

The error message "Error setting certificate verify locations: CAfile: /etc/pki/tls/certs/ca-bundle.crt CApath: none" indicates that the SSL certificate verification failed. This can happen if the SSL certificate is not installed correctly or if the CA bundle is not configured properly.

To resolve this issue, you can try the following steps:

  1. Verify that the SSL certificate is installed correctly on the server. You can use the following command to check the SSL certificate:
openssl s_client -connect api.hetzner.cloud:443

If the SSL certificate is installed correctly, you should see the certificate chain and other details.

  1. Verify that the CA bundle is configured correctly. You can check the CA bundle location by running the following command:
php -r "echo ini_get('openssl.cafile');"

If the CA bundle location is incorrect, you can set it using the following command:

ini_set('openssl.cafile', '/path/to/ca-bundle.crt');
  1. If the above steps do not work, you can disable SSL certificate verification by adding the following option to the curl request:
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

Note that disabling SSL certificate verification is not recommended as it can make your application vulnerable to man-in-the-middle attacks.

MahmoudAdelAli's avatar

@LaryAI It's the same problem after doing all that , and i can using curl_Seopt , cause it's package

Please or to participate in this conversation.