每当我将 wget 用于以下或通常的任何事情时,
sudo wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -
我收到一条错误信息:
--2020-04-24 20:41:33-- https://www.dropbox.com/download?plat=lnx.x86_64
Resolving www.dropbox.com (www.dropbox.com)... 162.125.6.1, 2620:100:601c:1::a27d:601
Connecting to www.dropbox.com (www.dropbox.com)|162.125.6.1|:443... connected.
ERROR: cannot verify www.dropbox.com's certificate, issued by ‘CN=DigiCert SHA2 Extended Validation Server CA,OU=www.digicert.com,O=DigiCert Inc,C=US’:
Unable to locally verify the issuer's authority.
To connect to www.dropbox.com insecurely, use `--no-check-certificate'.
gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now
这导致了更广泛的连接问题,但这是最常见和最直接的问题,我似乎找不到太多支持。使用 Ubuntu 20.04 并且实际上只是在 3 小时前对我的计算机进行了重新镜像(可能与此有关...)
通过运行 wget -d cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.17.2.tar.xz 编辑附加信息:
wget -d cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.17.2.tar.xz
DEBUG output created by Wget 1.20.3 on linux-gnu.
Reading HSTS entries from /home/negfrequency/.wget-hsts
URI encoding = ‘UTF-8’
Converted file name 'linux-4.17.2.tar.xz' (UTF-8) -> 'linux-4.17.2.tar.xz' (UTF-8)
--2020-04-24 20:33:17-- http://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.17.2.tar.xz
Resolving cdn.kernel.org (cdn.kernel.org)... 151.101.201.176, 2a04:4e42:50::432
Caching cdn.kernel.org => 151.101.201.176 2a04:4e42:50::432
Connecting to cdn.kernel.org (cdn.kernel.org)|151.101.201.176|:80... connected.
Created socket 3.
Releasing 0x00005588dc6a7f10 (new refcount 1).
---request begin---
GET /pub/linux/kernel/v4.x/linux-4.17.2.tar.xz HTTP/1.1
User-Agent: Wget/1.20.3 (linux-gnu)
Accept: */*
Accept-Encoding: identity
Host: cdn.kernel.org
Connection: Keep-Alive
---request end---
HTTP request sent, awaiting response...
---response begin---
HTTP/1.1 200 OK
Server: nginx
Content-Type: application/x-xz
Last-Modified: Sat, 16 Jun 2018 07:34:25 GMT
X-Frame-Options: DENY
X-Content-Type-Options: nosniff
Accept-Ranges: bytes
Age: 4
Content-Length: 102167060
Accept-Ranges: bytes
Date: Sat, 25 Apr 2020 00:33:22 GMT
Via: 1.1 varnish
Connection: keep-alive
X-Served-By: cache-dca17760-DCA
X-Cache: MISS
X-Cache-Hits: 0
X-Timer: S1587774798.899562,VS0,VE4554
---response end---
200 OK
Registered socket 3 for persistent reuse.
Length: 102167060 (97M) [application/x-xz]
Saving to: ‘linux-4.17.2.tar.xz’
linux-4.17.2.tar.xz 100%[===================>] 97.43M 6.87MB/s in 15s
2020-04-24 20:33:37 (6.35 MB/s) - ‘linux-4.17.2.tar.xz’ saved [102167060/102167060]
编辑:
附加信息/usr/bin/wget 是路径:
ii ca-certificates 20190110ubuntu1 all Common CA certificates
ii wget 1.20.3-1ubuntu1 amd64 retrieves files from the web
最佳答案
当您尝试访问的网站没有有效的 SSL 证书时,会弹出此错误。如果是这种情况,除非您拥有该远程网站,否则您将无法使用他们的 ssl 解决他们的问题。
因此 wget
的建议:使用 --no-check-certificate
参数,这样 wget 就不会在连接时尝试验证 SSL。
如果您的错误是:Unable to locally verify the issuer's authority
,那么您应该确保您的服务器/计算机 TIME 是正确的。
关于ubuntu - 每当我使用 wget 时出现证书错误消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61419286/