在Python中创建一个支持这样的请求的OCSP服务:openssl ocsp -issuer ca-cert.pem -cert 1.pem -cert 2.pem -cert 3.pem -no_nonce -url http://localhost/ocsp -noverify,我可以看到OCSP请求列表中填充了3个证书,但无法获得对3个证书的答复。查看asyn1crypto和ocspbuilder的源代码(如下所示),似乎只支持一个cert请求:
response_data = ocsp.ResponseData({
'responder_id': ocsp.ResponderId(name='by_key', value=responder_key_hash),
'produced_at': produced_at,
'responses': [
{
'cert_id': {
'hash_algorithm': {
'algorithm': self._key_hash_algo
},
'issuer_name_hash': getattr(self._certificate.issuer, self._key_hash_algo),
'issuer_key_hash': getattr(issuer.public_key, self._key_hash_algo),
'serial_number': self._certificate.serial_number,
},
'cert_status': cert_status,
'this_update': self._this_update,
'next_update': self._next_update,
'single_extensions': single_response_extensions
}
],
'response_extensions': response_data_extensions
})响应列表似乎只填充了一个元素。对于支持多个请求的证书的Python响应程序的实际实现,有什么想法或指针吗?
发布于 2018-11-13 00:49:36
因此,为了其他人的利益,回答我自己的问题:
asn1crypto确实支持多个证书ocspbuilder没有,因此为了支持多个证书并遵守OCSP响应中的RFC6960,代码如下:https://github.com/andrea-f/ocspbuilderhttps://stackoverflow.com/questions/53243747
复制相似问题