如何确定应将哪个 OCSP URL 用于 OpenSSL 证书?

信息安全 openssl ocsp
2021-08-31 17:42:08

我有一个对站点的叶子证书进行编码的 PEM 文件。我想通过查询相关的 OCSP 服务器来检查它是否被撤销,但我不知道要使用哪个 URL。

如何从证书中提取 OCSP URL?

1个回答

openssl x509当您使用以下-text选项时,此信息会公开:

$ openssl x509 -in cert.pem -noout -text

它在 x509v3 扩展块中可见:

Authority Information Access: 
  OCSP - URI:http://ocsp.int-x3.letsencrypt.org
  CA Issuers - URI:http://cert.int-x3.letsencrypt.org/

如果您只对这些信息感兴趣,您可以直接使用-ocsp_uri而不是-text

$ openssl x509 -in cert.pem -noout -ocsp_uri 
http://ocsp.int-x3.letsencrypt.org