【问题标题】:ocsp validate certificate by passing certificate text instead of fileocsp 通过传递证书文本而不是文件来验证证书
【发布时间】:2015-04-22 19:01:40
【问题描述】:

我正在尝试针对 ocsp 响应程序运行我的证书以检查其有效性。 我正在使用 Ruby on rails 但基本上将其作为系统命令运行

目前,以下命令有效并将结果存储在文件中。

command = "openssl ocsp -issuer #{Rails.root}/ca-cert.crt -cert #{Rails.root}/"+@filename+".crt -CAfile #{Rails.root}/ca-cert.crt -url "+CONFIG[:ocsp_responder] +" > " + outputfile"
system(command)

但我不想传递“@filename.crt”,而是想传递 public_certificate 本身。什么是合适的语法?

我尝试了以下方法:

 command = "openssl ocsp -issuer #{Rails.root}/cert/ca-cert.crt -cert #{cert} -CAfile #{Rails.root}/data/certs/ca-cert.crt -url "+CONFIG[:ocsp_responder] +" > " + outputfile
# cert = the certificate in text --BEGIN..blah blah.--END

这不起作用。是否有替代方案无需指定公共证书文件?

【问题讨论】:

    标签: ruby-on-rails ruby ssl openssl ocsp


    【解决方案1】:

    老实说,我不相信命令行 openssl 客户端会以任何形式接受证书作为字符串,假设您想要执行以下操作:
    cert = request.env['VAR_WITH_CERT]

    您可能需要浏览一些临时文件。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-06-09
      • 2010-10-01
      • 2021-12-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多