web-eid / ocsp-php

OCSP library for PHP
MIT License
3 stars 3 forks source link

OCSP request is malformed #19

Open hoels opened 1 month ago

hoels commented 1 month ago

Right now, the OCSP request always contains 3 elements:

$this->ocspRequest = [
    "tbsRequest" => [
        "version" => "v1",
        "requestList" => [],
        "requestExtensions" => [],
    ],
];

Always having requestList and requestExtensions causes additional nodes in the OCSP request, regardless of whether a value was added to it. This leads to a malformed OCSP request. For example, the Apple OCSP responder does not respond to requests created with this library anymore. The solution is to remove the empty arrays, since they will be created automatically when a value is added to it.