此文章解决AlpineLinx出现wget: error getting response: Connection reset by peer 的方法。

此问题出现在全新安装的AlpineLinux上,具体表现为wget文件时,如果是http链接,可以正常wget到,如果是https链接,就会提示wget: error getting response: Connection reset by peer。

类似于此图:

cikeblog:~# wget cikeblog.com/s/alpiness.sh
Connecting to cikeblog.com (159.138.1.106:80)
Connecting to cikeblog.com (159.138.1.106:443)
wget: error getting response: Connection reset by peer
解决办法:
apk update
apk add ca-certificates
update-ca-certificates
apk --no-cache add openssl wget
Alpine终端执行以上代码后,即可wget到https链接的文件。

过程:首先怀疑是证书问题,安装ca-certificates证书,问题复现,然后重新安装一下wget,问题解决。

参考文章:https://github.com/Yelp/dumb-init/issues/73