Fetching OCSP responses may result in TypeError
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 115
- Forks
- 34
- PR merge metrics
- No merged PRs in 30d
Description
First of all, thank you for certvalidator! It makes an important task easy to complete in Python. 👍
While I was experimenting with certificate revocation status checking I ran into some issues. I'll create separate GitHub issues for those.
When certvalidator tries to fetch OCSP responses, but the certificate to be validated does not contain any reference to OCSP responders, TypeError is raised:
TypeError: exceptions must derive from BaseException
The root of that error is that cert.ocsp_urls returns an empty list, so at the end of the following code block None is raised:
The cert.ocsp_urls == [] case could be handled here (for safety) e.g. by raising an appropriate error, but in that case ocsp_client.fetch probably shouldn't be called at all, since it can not return any meaningful result.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in certvalidator/ocsp_client.py around lines 89-109 and inspect how an empty cert.ocsp_urls list reaches the fetch logic. Reproduce validation with a certificate that has no OCSP responder reference, then define handling that avoids raising None as an exception and confirms ocsp_client.fetch is not called when no responder is available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100