Saya punya masalah aneh. Diperbarui mesin dev LAMP saya (Debian) ke PHP 7. Setelah itu saya tidak dapat terhubung ke API terenkripsi TLS tertentu melalui Curl lagi.
Sertifikat SSL yang dimaksud ditandatangani oleh thawte.
curl https://example.com
memberi saya
curl: (60) SSL certificate problem: unable to get local issuer certificate
sedangkan
curl https://thawte.com
yang — tentu saja — juga ditandatangani oleh karya-karya Thawte.
Saya dapat mengakses situs API melalui HTTPS di komputer lain, mis. Desktop saya via curl dan di browser. Jadi, sertifikat itu jelas valid. Peringkat SSL Labs adalah A.
Setiap permintaan Curl lain dari mesin dev saya ke situs SSL terenkripsi lainnya berfungsi. Sertifikat root saya terbaru. Untuk memverifikasi, saya berlari update-ca-certificates
. Saya bahkan mengunduh http://curl.haxx.se/ca/cacert.pem ke / etc / ssl / certs dan berlari c_rehash
.
Masih kesalahan yang sama.
Apakah ada cara untuk men-debug proses verifikasi dan melihat mana curl sertifikat penerbit (atau openssl) yang mencari tetapi tidak menemukan, yaitu nama file?
MEMPERBARUI
curl -vs https://example.com
beritahu saya (IP + Domain dianonimkan)
* Hostname was NOT found in DNS cache
* Trying 192.0.2.1...
* Connected to example.com (192.0.2.1) port 443 (#0)
* successfully set certificate verify locations:
* CAfile: none
CApath: /etc/ssl/certs
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS alert, Server hello (2):
* SSL certificate problem: unable to get local issuer certificate
* Closing connection 0
Dan
echo | openssl s_client -connect example.com:443
memberi
CONNECTED(00000003)
depth=2 C = US, O = "thawte, Inc.", OU = Certification Services Division, OU = "(c) 2006 thawte, Inc. - For authorized use only", CN = thawte Primary Root CA
verify error:num=20:unable to get local issuer certificate
verify return:0
---
Certificate chain
0 s:/C=DE/ST=XYZ/CN=*.example.com
i:/C=US/O=thawte, Inc./CN=thawte SSL CA - G2
1 s:/C=US/O=thawte, Inc./CN=thawte SSL CA - G2
i:/C=US/O=thawte, Inc./OU=Certification Services Division/OU=(c) 2006 thawte, Inc. - For authorized use only/CN=thawte Primary Root CA
2 s:/C=US/O=thawte, Inc./OU=Certification Services Division/OU=(c) 2006 thawte, Inc. - For authorized use only/CN=thawte Primary Root CA
i:/C=ZA/ST=Western Cape/L=Cape Town/O=Thawte Consulting cc/OU=Certification Services Division/CN=Thawte Premium Server CA/emailAddress=premium-server@thawte.com
---
Server certificate
-----BEGIN CERTIFICATE-----
[...]
-----END CERTIFICATE-----
subject=/C=DE/ST=XYZ/CN=*.example.com
issuer=/C=US/O=thawte, Inc./CN=thawte SSL CA - G2
---
No client certificate CA names sent
---
SSL handshake has read 4214 bytes and written 421 bytes
---
New, TLSv1/SSLv3, Cipher is ECDHE-RSA-AES256-GCM-SHA384
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
SSL-Session:
Protocol : TLSv1.2
Cipher : ECDHE-RSA-AES256-GCM-SHA384
Session-ID: [...]
Session-ID-ctx:
Master-Key: [...]
Key-Arg : None
PSK identity: None
PSK identity hint: None
SRP username: None
TLS session ticket lifetime hint: 300 (seconds)
TLS session ticket:
0000 - 5a 95 df 40 2c c9 6b d5-4a 50 75 c5 a3 80 0a 2d Z..@,.k.JPu....-
[...]
00b0 - d5 b9 e8 25 00 c5 c7 da-ce 73 fb f2 c5 46 c4 24 ...%.....s...F.$
Start Time: 1455111516
Timeout : 300 (sec)
Verify return code: 20 (unable to get local issuer certificate)
---
DONE
curl -vs https://example.com echo | openssl s_client -connect example.com:443