红帽 - 接受自签名证书

发布于 2024-10-08 20:31:02 字数 255 浏览 0 评论 0原文

有没有办法让 Red Hat Linux 机器信任自签名证书?

例如 wget https://example.com - 给出一个错误,表明证书不受信任,为“https://example.com”拥有自签名证书;使用 wget '--no-check-certificate' 可以覆盖证书检查。但我想让红帽隐式信任自签名证书 - 有没有办法做到这一点?

谢谢。

Is there a way I can get a Red Hat Linux box to trust a self-signed certificate?

e.g. wget https://example.com - gives an error that certificate is untrusted as 'https://example.com' has a self-signed certificate; with wget '--no-check-certificate' can over-ride checking of the certificate. But I would like to get the Red Hat to implicitly trust the self-signed certificate - is there a way to do this?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦断已成空 2024-10-15 20:31:02

这本身不是一个编码/编程问题,但我认为这个答案在编写软件时可能同样有效,所以我无论如何都会发布它。

在您正在使用的计算机系统或您正在编写的软件中默认信任自签名证书是一个糟糕的主意。如果您接受所有证书,那么中间人攻击就会变得微不足道。攻击者所需要做的就是向您提供自签名证书,并对流量进行解密和重新加密。

通常,对于这种情况,您需要创建自己的证书颁发机构,用它签署您的证书,并将其添加到 /etc/ca-certificates.conf 或 Red Hat 使用的任何内容。

如果您正在编写自己的软件,我还会跟踪给定主机提供的旧证书,这样如果它已更改,我就会收到警告,因为我怀疑完全信任全局 CA 是否明智。

我认为以下是最佳实践:

  1. 对于您自己的服务,或者对于需要表明服务是由您信任的给定实体提供的任何内容,请创建一个 CA 并将其用于证书。
  2. 对于其他任何事情,在保留安全令牌(SSL 证书指纹、SSH/GPG 指纹等)后建立安全连接,并警惕它是否已更改。如果您很偏执,请在第一次使用时通过从不同位置连接或使用几天或通过其他渠道来确保指纹没问题(这并不重要,因为首次连接期间出现 MITM 的可能性非常低)概率 - 但仍然不可忽略)。

That's not a coding/programming question per se, but I figure this answer might be equally valid when writing software, so I'll post it anyway.

Trusting self-signed certificates by default in a computer system you're using or software that you're writing is a terrible idea. If you accept all certificates it would make a man in the middle attack trivial. All the attacker needs to do is to present a self-signed certificate to you and decrypt and re-encrypt the traffic.

Usually for such situations you need to create your own certificate authority, sign your certificates with it, and add it to /etc/ca-certificates.conf or whatever Red Hat uses.

If you were writing software of your own, I'd also keep track of the old certificates that a given host provided, so that I'm warned if it had changed because I have my doubts that fully trusting global CAs is wise.

I'd say the following are best practice:

  1. For services of your own, or for anything that needs to signify that services are provided by a given entity you trust, create a CA and use it for the certificates.
  2. For anything else, establish a secure connection once keeping the security token (SSL certificate fingerprint, SSH/GPG fingerprint, etc.), and be wary if it has changed. If you are paranoid, it the first use make sure that the fingerprint is OK by connecting from various places or using it for a few days or by another channel (not really important because the chance of a MITM during the first connect has a very low probability - but still not negligable).
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文