gpt4 book ai didi

ubuntu - openssl/wget 仅在我明确指定 ca 目录时才工作

转载 作者:太空宇宙 更新时间:2023-11-03 13:20:24 24 4
gpt4 key购买 nike

如果我尝试使用 openssl 或 wget 而未明确传递 ca 目录,则证书无法验证。我想让 ubuntu 回到原始状态,轻松验证像 google.com 这样的正常网站。是否有我需要设置的环境变量,或者我需要启用符号链接(symbolic link)才能正确配置?

chris@chris:~$ wget --ca-directory=/etc/ssl/certs https://google.com
--2019-04-13 12:42:12-- https://google.com/
Resolving google.com (google.com)... 172.217.4.206, 2607:f8b0:4009:807::200e
Connecting to google.com (google.com)|172.217.4.206|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://www.google.com/ [following]
--2019-04-13 12:42:12-- https://www.google.com/
Resolving www.google.com (www.google.com)... 172.217.4.36, 2607:f8b0:4009:80f::2004
Connecting to www.google.com (www.google.com)|172.217.4.36|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘index.html.5’

index.html.5 [ <=> ] 11.07K --.-KB/s in 0.004s

2019-04-13 12:42:12 (2.88 MB/s) - ‘index.html.5’ saved [11340]

chris@chris:~$ wget https://google.com
--2019-04-13 12:42:19-- https://google.com/
Resolving google.com (google.com)... 172.217.4.206, 2607:f8b0:4009:807::200e
Connecting to google.com (google.com)|172.217.4.206|:443... connected.
ERROR: cannot verify google.com's certificate, issued by ‘CN=Google Internet Authority G3,O=Google Trust Services,C=US’:
Unable to locally verify the issuer's authority.
To connect to google.com insecurely, use `--no-check-certificate'.

如果我没有显式传入 -CApath,这与 openssl 的行为相同

-----END CERTIFICATE-----
subject=/C=US/ST=California/L=Mountain View/O=Google LLC/CN=www.google.com
issuer=/C=US/O=Google Trust Services/CN=Google Internet Authority G3
---
No client certificate CA names sent
Peer signing digest: SHA256
Server Temp Key: X25519, 253 bits
---
SSL handshake has read 2962 bytes and written 261 bytes
Verification error: unable to get local issuer certificate
---

最佳答案

这解决了我的问题

导出 SSL_CERT_DIR=/etc/ssl/certs

关于ubuntu - openssl/wget 仅在我明确指定 ca 目录时才工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55668236/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com