ubuntu - openssl/wget 仅在我明确指定 ca 目录时才有效
问题描述
如果我尝试使用 openssl 或 wget 而不显式传入 ca 目录,则证书无法验证。我想让 ubuntu 恢复到可以轻松验证普通网站(如 google.com)的原始状态。我需要设置一个环境变量,还是我需要启用一个符号链接才能正确配置它?
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'.
如果我没有明确传入,这与 openssl 的行为相同-CApath
-----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
---
解决方案
这解决了我的问题
export SSL_CERT_DIR=/etc/ssl/certs
推荐阅读
- ubuntu - 如何将持久静态路由添加到由 Network Manager 管理的 Ubuntu?
- ios - 如果不是从 Xcode 运行,iOS 应用程序会立即崩溃
- c# - 嵌套 Web 应用程序中 404 页面的正确代码
- python - 如何使用 for 循环手动将对象添加到 Django 模型?
- android - 跨行动态拉伸表格单元格以适应其内容
- java - 如何修复我的应用程序崩溃而不是拨打电话?
- asp.net - 你可以在 ASP 中堆叠多个 IF 语句吗?我的不工作
- highcharts - 显示多行系列时,Highcharts单击事件未触发
- python-3.x - 如何在 Python 3.x 中使用 for 循环来解决这个难题?
- android - 2 orderby 方法在 firebase firestore android 上无法正常工作