【问题标题】:Validating SSL certificate behind firewall在防火墙后面验证 SSL 证书
【发布时间】:2020-12-14 16:35:45
【问题描述】:

我正在使用 SSL 证书连接到第 3 方服务。我的服务器在防火墙后面运行,阻止了传出流量。应用程序无法验证第 3 方证书。

MailKit.Security.SslHandshakeException: An error occurred while attempting to establish an SSL or TLS connection.

The server's SSL certificate could not be validated for the following reasons:
• The server certificate has the following errors:
  • The revocation function was unable to check revocation for the certificate.
  • The revocation function was unable to check revocation because the revocation server was offline.
• An intermediate certificate has the following errors:
  • The revocation function was unable to check revocation for the certificate.
  • The revocation function was unable to check revocation because the revocation server was offline.

我试图用谷歌搜索客户端如何验证证书链,但没有找到。我对应用程序/服务器正在执行其验证查询的端口和地址特别感兴趣。

作为即时修补程序,我必须允许到所有目的地的纯 HTTP 传出流量。

【问题讨论】:

  • OCSP 服务器 URL 写入根证书。必须在那里搜索。
  • OCSP 通常使用纯 HTTP,因此使用端口 80。要使用的 URL 也可能在中间证书中,而不仅仅是根(自签名)证书。
  • 听起来你需要turn off revocation checking。 (真的,最好将其设置为软故障,但我没有看到这样做的方法。)
  • @GordonDavisson 我能够管理防火墙规则,不想因为我不知道事情是如何运作而牺牲安全性。

标签: .net ssl firewall


【解决方案1】:

OCSP(在线证书状态协议)URL 可以在证书链的任何级别(根、中间、叶)中找到。

基于this answer,可以使用openssl找到应用的url:

openssl x509 -in cert.pem -noout -ocsp_uri

幸运的是,Fortigate 防火墙的 Internet Service 数据库中有主要的 OCSP 服务器,所以我不需要一一检查。

无论如何,OCSP 实施几乎没有问题,OCSP Stapling 正在尝试解决其中一个问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-06-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多