在 Cygwin 中的 HTTPS URL 上运行 wget 时,如何修复证书错误? [英] How do I fix certificate errors when running wget on an HTTPS URL in Cygwin?

查看:25
本文介绍了在 Cygwin 中的 HTTPS URL 上运行 wget 时,如何修复证书错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,运行 wget https://www.dropbox.com 会导致以下错误:

For example, running wget https://www.dropbox.com results in the following errors:

ERROR: The certificate of `www.dropbox.com' is not trusted.
ERROR: The certificate of `www.dropbox.com' hasn't got a known issuer.

推荐答案

看到这里目前的 hacky 解决方案,我觉得我毕竟必须描述一个合适的解决方案.

Looking at current hacky solutions in here, I feel I have to describe a proper solution after all.

首先,您需要通过 Cygwin 的 setup.exe 安装 cygwin 包 ca-certificates 以获取证书.

First, you need to install the cygwin package ca-certificates via Cygwin's setup.exe to get the certificates.

不要使用 curl 或类似的黑客来下载证书(作为邻近答案的建议),因为这从根本上是不安全的,可能会危及系统.

Do NOT use curl or similar hacks to download certificates (as a neighboring answer advices) because that's fundamentally insecure and may compromise the system.

第二,你需要告诉 wget 你的证书在哪里,因为它不会在 Cygwin 环境中默认选择它们.如果您可以使用命令行参数 --ca-directory=/usr/ssl/certs(最适合 shell 脚本)或添加 ca_directory =/usr/ssl/certs~/.wgetrc 文件.

Second, you need to tell wget where your certificates are, since it doesn't pick them up by default in Cygwin environment. If you can do that either with the command-line parameter --ca-directory=/usr/ssl/certs (best for shell scripts) or by adding ca_directory = /usr/ssl/certs to ~/.wgetrc file.

您也可以通过运行 ln -sT/usr/ssl/etc/ssl 来解决这个问题,正如另一个答案中指出的那样,但是只有当您对系统.我描述的其他解决方案不需要.

You can also fix that by running ln -sT /usr/ssl /etc/ssl as pointed out in another answer, but that will work only if you have administrative access to the system. Other solutions I described do not require that.

这篇关于在 Cygwin 中的 HTTPS URL 上运行 wget 时,如何修复证书错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆