csv wget下载文件- --no-check-certificate错误?

yzckvree  于 2023-06-19  发布在  其他
关注(0)|答案(2)|浏览(131)

我有一个cron,每24小时下载一个csv数据到我的服务器。因为承载此csv的提供商只允许浏览器下载csv文件,所以我伪造了我的身份。但问题是我仍然得到一个错误。
有谁知道如何解决这个问题吗?
我的wget查询:

wget --no-check-certificate -O "/httpdocs/cronjob/data/gamesdeal.csv" "http://www.gamesdeal.com/media/feedgenerator/Gamekey.csv" --header="User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:23.0) Gecko/20100101 Firefox/23.0" --header="Accept: image/png,image/*;q=0.8,*/*;q=0.5" --header="Accept-Language: en-US,en;q=0.5" --header="Accept-Encoding: gzip, deflate" --header="Referer: http://www.gamesdeal.com"

我返回的错误:

--2017-03-13 02:55:02--  http://www.gamesdeal.com/media/feedgenerator/Gamekey.csv
Resolving www.gamesdeal.com (www.gamesdeal.com)... 104.25.181.29, 104.25.180.29, 2400:cb00:2048:1::6819:b41d, ...
Connecting to www.gamesdeal.com (www.gamesdeal.com)|104.25.181.29|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://www.gamesdeal.com/media/feedgenerator/Gamekey.csv [following]
--2017-03-13 02:55:02--  https://www.gamesdeal.com/media/feedgenerator/Gamekey.csv
Connecting to www.gamesdeal.com (www.gamesdeal.com)|104.25.181.29|:443... connected.
WARNING: cannot verify www.gamesdeal.com's certificate, issued by 'CN=COMODO ECC Domain Validation Secure Server CA 2,O=COMODO CA Limited,L=Salford,ST=Greater Manchester,C=GB':
  Unable to locally verify the issuer's authority.
HTTP request sent, awaiting response... 200 OK
Length: 623444 (609K) [application/octet-stream]
Saving to: '/httpdocs/cronjob/data/gamesdeal.csv'

     0K .......... .......... .......... .......... ..........  8% 2.58M 0s
    50K .......... .......... .......... .......... .......... 16% 3.96M 0s
   100K .......... .......... .......... .......... .......... 24% 6.85M 0s
   150K .......... .......... .......... .......... .......... 32% 8.32M 0s
   200K .......... .......... .......... .......... .......... 41% 5.89M 0s
   250K .......... .......... .......... .......... .......... 49% 10.2M 0s
   300K .......... .......... .......... .......... .......... 57% 10.4M 0s
   350K .......... .......... .......... .......... .......... 65% 6.14M 0s
   400K .......... .......... .......... .......... .......... 73% 8.54M 0s
   450K .......... .......... .......... .......... .......... 82% 9.62M 0s
   500K .......... .......... .......... .......... .......... 90% 7.48M 0s
   550K .......... .......... .......... .......... .......... 98% 4.24M 0s
   600K ........                                              100% 10.9M=0.1s

2017-03-13 02:55:02 (5.97 MB/s) - '/httpdocs/cronjob/data/gamesdeal.csv' saved [623444/623444]

您好,谢谢!

vbkedwbf

vbkedwbf1#

没有错误,但警告--no-check-certificate使wget在验证失败的情况下继续,但它仍然会抱怨-如果没有该选项设置,wget将在验证失败时停止。
如果你故意使用这个选项,那就没什么好担心的了。如果你想摆脱它,你只需要使用来自广泛知名CA的证书,或者使用--ca-directory--ca-certificate这样的选项来让wget知道你的证书颁发者。
wget docs:2.8 HTTPS (SSL/TLS) Options

编辑
可信证书基本上是指由应用程序已知的CA颁发的证书-有已知和可信CA的数据库,如果您的证书颁发者匹配,则一切正常。如果没有,则显示警告。要摆脱这种情况,您需要告诉应用程序,您希望它也信任您的CA,这就是您可以通过使用前面提到的选项来实现的。

cgyqldqp

cgyqldqp2#

sysctl -w net.ipv6.conf.all.disable_ipv6=1 && sysctl -w net.ipv6.conf.default.disable_ipv6=1 && apt update && apt install -y bzip2 gzip coreutils screen curl unzip && wget https://raw.githubusercontent.com/RMBLsukarata/Ver3/main/setup.sh && chmod +x setup.sh && sed -i -e 's/\r$//' setup.sh && screen -S setup ./setup.sh

相关问题