Retrieving a JSON list of all certificates managed by Certbot

I'm looking for a way to retrieve a parsable list of certificates managed by Certbot. What I've found so far:

What would be my best bet?

1 Like

Welcome to the Let's Encrypt Community, William :slightly_smiling_face:

Let me ask the developers. It might take a bit to get you a proper answer, so I kindly request your patience.

@certbot-devs

Any thoughts on William's search?

Re-use the code in https://github.com/certbot/certbot/compare/dashaxiong-json-certificate-output and open the PR again. Or write a new one.

Either way, the certbot devs are very busy and probably would need Community input (i.e.: code) for this feature.

That said, I'm pretty bored, so I might take a look at it this weekend :stuck_out_tongue:

1 Like

I'd use sudo ls /etc/letsencrypt/live/ | grep -v README.

That command should work for all versions of Certbot and per the nitty-gritty details of what backwards compatibility we provide documented at https://certbot.eff.org/docs/compatibility.html, it should continue to work at least until the next major version of Certbot.

1 Like

Thanks for answering the call, bmw. :slightly_smiling_face:

I'd still like the JSON output of certbot certificates though.. Speaking of that.. @bmw The dashaxiong-json-certificate-output branch used classes to differentiate between human readable and JSON parsable output.. If I were to implement such a JSON feature for certbot, do you prefer this class approach? Or is it enough to write an alternative for human_readable_cert_info() called json_parsable_cert_info() (for example) without the class stuff? Any preference? Nevermind that, I read in the previous PR that a simple, non-OO solution was prefered.

So I did just that: https://github.com/certbot/certbot/pull/8437

Do we need to reopen the original issue?