我正在尝试验证 OCSP 服务器上的客户端证书,但失败了。
这是我要运行的命令:
openssl ocsp -issuer test_ca_cert.pem -cert my_test_client_cert.pem -text -url http://demo.server.com/ocsp
这是输出:
OCSP Request Data:
...
OCSP Response Data:
....
Certificate:
...
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
Response Verify Failure
140530622551704:error:27069065:OCSP routines:OCSP_basic_verify:certificate verify error:ocsp_vfy.c:138:Verify error:unable to get local issuer certificate
my_test_client_cert.pem: good
This Update: Jan 17 15:56:46 2017 GMT
我检查了我的客户端证书中的 Issuer 是否与 test_ca_cert.pem 中的相同。
我做错了什么?我该如何解决这个问题?
谢谢
最佳答案
按照@pedrofb 的建议使用-CAfile
对我有用,但既不使用根证书也不使用中间证书,而是将根证书和中间证书捆绑在一起(即 cat root.pem intermediate.pem > bundle.pem
):
openssl ocsp \
-CAfile root.cert.pem \
-issuer intermediate.cert.pem \
-cert server.cert.pem \
-text \
-url http://ocsp.example.com
关于ssl - 为什么我会收到验证错误 :unable to get local issuer certificate when I run openssl ocsp?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41701860/