大网数据广告活动
服务器运维问答

Fixing wget certificates

· 52CE 我爱测

Basically, I was testing different versions of OpenSSL, and somewhere in the process broke wget's path to certificates. wget https://www.google.com Results now in: ERROR: cannot verify www.google.com's certificate, issued by 'CN=…

问题原文

原帖链接 · Ilya · CC BY-SA 3.0

Basically, I was testing different versions of OpenSSL, and somewhere in the process broke wget's path to certificates.

wget https://www.google.com 

Results now in:

ERROR: cannot verify www.google.com's certificate, issued by 'CN=Google Internet Authority G2,O=Google Inc,C=US':
Unable to locally verify the issuer's authority.
To connect to www.google.com insecurely, use `--no-check-certificate'.

Which makes me think that wget doesn't know where to look for certificates, as ca-certificates is installed and if I set export SSL_CERT_DIR=/etc/ssl/certs everything works until reboot.

How can I permanently fix this? I want to revert to the original state, where wget automatically knows where to check certificates.

I can probably set this export on boot, but what it the right place, where it originally was?

Edit:

On another server, I've checked and there is no SSL_CERT_DIR variable in the environment, yet wget works correctly. How does wget knows where to look for certificates?

社区高分解答

原帖链接 · darnir · CC BY-SA 3.0

Usually, the distribution will specify this in the global wgetrc file. For example, Arch Linux has this in /etc/wgetrc:

ca_certificate=/etc/ssl/certs/ca-certificates.crt

So, just find where your certificates live, and pass it to wgetrc.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-02-07)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。