Use cerbot as python code, and not as command

Hi.
Is it possible to use cerbot as python code, and not as command?

I work with certbot, and I use python. Certbot can display some interactive messages during it's execution. But for python more usefull are errors instead of these messages.

Short answer: it's possible, but it's poorly documented.

3 Likes

It is possible but not recommended. Please reference this discussion from last week: The way to call ACME procedure from python

4 Likes

Thanks! This is helpful. I think, I will call command from within python.

Also, I find this example how to make all by code:

It seems easy.

2 Likes

Yes. Please note, that is not invoking Certbot with Python - but the ACME library the Certbot developers use and maintain. If you have any issues with that, there are many other ACME libraries available on PyPi.

Using an ACME library is what most people who want to invoke Certbot within Python actually want to do. The bulk of Certbot's code is for managing nginx/apache installations and the user interface, not as an ACME client.

7 Likes

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