У меня есть несколько PHP-скриптов, которые используют curl для взаимодействия с различными сервисами.В настоящее время сертификат SSL одного из этих сервисов обновлен, и мой локоть начал плакать по этому поводу, когда я пытаюсь получить его из CLI моего сервера:
~$ curl https://example.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.
В настоящее время я жестко закодировал verify => false
для всех моих запросовчтобы мои скрипты работали, но это не то, что я хотел бы выложить.
Я получил последний файл cacert от mozilla , поместил его в /etc/ssl/certs/ca-certificates.crt
и затем запустил sudo update-ca-certificates
, который успешно работал (я полагаю ..)
~$ sudo update-ca-certificates
Updating certificates in /etc/ssl/certs...
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.
Но опять же, curl не слишком доволен этим, все равно не может получить свой ресурс, не пройдя флаг -k
.