Mám veľa skriptov PHP, ktoré používajú skrúteniekomunikovať s rôznymi službami. V súčasnosti jedna z týchto služieb „SSL certifikát bol aktualizovaný a môj zvlnenie o ňom začalo plakať, keď sa ho snažím získať z CLI môjho servera:
~$ 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.
V súčasnej dobe som napevno verify => false
na všetky moje žiadosti, aby som udržal svoje skripty v prevádzke, ale nie je to niečo, čo by som chcel mať okolo.
Dostal som najnovšie sprievodný súbor z mozilly, Vlož to /etc/ssl/certs/ca-certificates.crt
a potom bežal sudo update-ca-certificates
ktoré bežali úspešne (predpokladám ..)
~$ sudo update-ca-certificates
Updating certificates in /etc/ssl/certs...
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.
Ale potom sa skrútenie nie je príliš nadšené z toho, stále nemôžem získať môj zdroj bez absolvovania -k
flag.
odpovede:
0 pre odpoveď č. 1Môžete použiť openssl s_client
príkaz na ďalšie ladenie problému, aby sa zistilo, čo presne sa zdá byť problémom s certifikátom.
openssl s_client -showcerts -servername myservice.com -connect myservice.com:443