
我在使用curl時遇到了這個錯誤:
curl https://www.google.com -v
* About to connect() to www.google.com port 443 (#0)
* Trying 2607:f8b0:400e:c01::67...
* Failed to connect to 2607:f8b0:400e:c01::67: Network is unreachable
* Trying 74.125.28.103...
* Adding handle: conn: 0x4041f868e0
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x4041f868e0) send_pipe: 1, recv_pipe: 0
* Connected to www.google.com (74.125.28.103) port 443 (#0)
* error setting certificate verify locations:
CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: none
* Closing connection 0
忽略網路無法存取...每個 https:// url 都會發生這種情況,即使網路可以存取。
我不會手動安裝證書,因為它應該自動獲取它們......想法?
答案1
使固定。我不知道問題是什麼,但它與憑證(ca-certificates)套件有關。
ca-certificates
通過添加並運行已修復update-ca-certificates
我使用的發行版是 Alpine LInux,所以指令是:
apk add ca-certificates
update-ca-certificates
在 Debian 中也應該是:
apt-get install ca-certificates
update-ca-certificates