Testing renew-hooks

Is there any way of forcing ther renewal / pre and post hooks to be called outside of the renewal window (for testing a cron job?). --dry-run seems to explicitly not call them so unless I’ve actually got a cert due for renewal it seems impossible to check that the syntax for a hook will be correct when invoked…

Hi @rsouthgate,

I think the combination of the certbot command line flags for the staging environment (--staging) and --force-renewal are one way to do this.

Someone more familiar with Certbot/plugin development might have an easier/alternative way.

@rsouthgate, a subtlety of @cpu’s response is that, while --dry-run implies --staging, --staging doesn’t automatically imply --dry-run. Thus, it is possible to actually obtain certs with --staging, which I think then would run the associated hooks.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.