我正在尝试针对 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
这不起作用。有没有无需指定公共证书文件的替代方法?