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

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

问题描述

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

 错误:www.dropbox.com的证书不受信任。 
错误:`www.dropbox.com'的证书没有已知的颁发者。


解决方案

看看目前的黑客解决方案,

需要安装cygwin软件包 ca-certificates / code>通过Cygwin的setup.exe获取证书。



不要使用curl或类似的hack下载证书(作为邻近的答复建议),因为这根本不安全,可能会危及系统。 / p>

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



你也可以通过运行 ln -sT / usr / ssl / etc / ssl 来解决这个问题,正如在另一个答案中指出的,但只有当你对系统具有管理权限。我描述的其他解决方案不需要。


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.

解决方案

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

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

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.

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.

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天全站免登陆