Commit Graph

2 Commits

Author SHA1 Message Date
Kenneth Jenkins
2b4a688bf9
Add OCSP stapling unit tests (#259)
Add a few tests to exercise OCSP stapling, using an httptest.Server
acting as the OCSP responder.

These tests are very simplistic:
 - a "good" OCSP response should be stapled
 - a "revoked" OCSP response should not be stapled
 - the DisableStapling option should be honored
 - OCSP stapling requires an issuing certificate

No attempt is made to provide sensible timestamps, either in the test
certificates or in the OCSP responses.

This brings unit test coverage for ocsp.go from 21% to 70%.
2023-11-28 21:26:51 -07:00
Kenneth Jenkins
693a79bb13
Define a NoOCSPServerSpecified error (#245)
Define an exported NoOCSPServerSpecified error, to make it easier to
distinguish the case that a certificate does not support OCSP (from
other OCSP stapling errors). Add a unit test exercising this behavior.
2023-07-17 19:42:48 -06:00