I was checking OCSP status of certain end points using the answer posted at the following: [1]: How to check OCSP client certificate revocation using Python Requests library?
I ran into an issue trying to validate oscp status for certs issued by zeroSSL, in that, the status returns unauthorised, however, checking it via some online webservice returned status as Good.
Changed the algorithm from a sha256 to sha1 in the ocsp request builder,and it worked. Where is this hash algorithm defined, is it algo that the ocsp server uses to sign the request i presume..?
How do i find the algo used by the ocsp server before hand or is it possible to predetermine the hash algo the ocsp server uses?
def Get_OCSP_ReqBuilder(clientcert,issuercert,ocsp_location): builder = OCSPRequestBuilder() req = builder.add_certificate(clientcert,issuercert,SHA256()) # Replaced A SHA1() here. req2 = req.build() req_path = base64.b64encode(req2.public_bytes(serialization.Encoding.DER)) ocsp_requestencoded = urljoin(ocsp_location + '/', req_path.decode('ascii')) return ocsp_requestencoded