Skip to content

Feature request: exported variable for the "no OCSP server specified in certificate" error #244

@kenjenkins

Description

@kenjenkins

What would you like to have changed?

Could certmagic define an exported error value for the "no OCSP server specified in certificate" error returned here?

return nil, nil, fmt.Errorf("no OCSP server specified in certificate")

For example:

var ErrNoOCSPServerSpecified = errors.New("no OCSP server specified in certificate")

Why is this feature a useful, necessary, and/or important addition to this project?

When using a mix of certificates (some managed by certmagic, and some not), we can end up with some spurious "no OCSP stapling for [domain]" errors, for those certificates not managed by certmagic. I'd like to selectively ignore this specific error, while still logging any other errors from the OCSP code.

If the certmagic API included an exported error value for this case, then we could use errors.Is() to check for this specific error. This feels more "correct" to me than matching against the error message text.

I expect the maintenance burden for the exported error value to be minimal.

What alternatives are there, or what are you doing in the meantime to work around the lack of this feature?

In the meantime, we can do a strings.Contains() check on the error message, looking for the substring "no OCSP server specified in certificate".

Please link to any relevant issues, pull requests, or other discussions.

n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestRequest for new feature or functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions