0

На сайте установле SSL сертификат, браузер его видит и поддерживает.

SSL сертификат

Но curl при попытке загрузки адреса выдаёт ошибку:

mcfinley@mcfinley-Lenovo-G570:~$ curl --cert-status https://***.com
curl: (60) server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.

Аналогично на PHP:

Допустим я запущу такой код:

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://мой-домен.com");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

$output = curl_exec($ch);

if ( $output === FALSE ) {
  var_dump(curl_error($ch));
} else {
  var_dump($output);
}
curl_close($ch);

Результатом будет string(63) "SSL certificate problem: unable to get local issuer certificate"

7
  • Покажите ваш код CURL
    – Arsen
    29 янв 2017 в 10:46
  • curl --cert-status https://домен-моего-сайта.com
    – user235441
    29 янв 2017 в 10:47
  • Вы через SSH делаете запрос? вы просто проверяете сертификат или отправляете какие то данные на данный ресурс ?
    – Arsen
    29 янв 2017 в 10:51
  • Обычный get запрос с помощью curl'a, никаких данных, без SSH. Если я задаю вопрос неправильно, поправьте меня. Я просто открываю терминал, пишу curl https://домен-моего-сайта.com и получаю сообщение, приведенное в теле вопроса: curl: (60) server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none More details here: http://curl.haxx.se/docs/sslcerts.html
    – user235441
    29 янв 2017 в 10:56
  • Затрудняюсь вам помочь, т.к сам никогда не пробовал запустить CURL именно через терминал(CMD), только посредством PHP->curl. Возможно найдутся знатоки ))
    – Arsen
    29 янв 2017 в 11:10

0

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge you have read our privacy policy.

Посмотрите другие вопросы с метками или задайте свой вопрос.