Debugging Certbot with IDE


#1

If there is existing documentation, please point me to the right direction.

I am hoping to be able to run certbot locally (on the Mac) or through IDE so that I can step through it. Is it something that is doable?

Thank you


#2

Hi,

Can you please elaborate your question?

(You want to run the program on mac then what??)

This might be the website you need:

Thank you


#3

I would like to do the following if possible:

  1. use an IDE such as Intellij to import the certbot source code
  2. run the certbot code in debug mode so that it can pause at the breakpoints.

Does this provide enough information for my questions?

Thank you.


#4

Okay…

let me call staff to help.

@bmw

Thank you


#5

I’ll note that Certbot is developed in Python. You can run it locally on your own workstation if you choose, although some of its automation is designed to be used on the same machine that functions as your web server, so you’ll probably only be able to effectively use the --manual method when running locally on a workstation (not, for example, --apache or --nginx methods). This can be a significant limitation because you might not always be able to replicate a realistic configuration related to obtaining and installing certificates, unless it’s for a domain name that’s pointed at the same machine you’re running Certbot on.

I don’t know whether your IDE is able to step through Python programs, but if so, it should work fine!

Some other debugging options that might be useful to you:

  • The Python pdb module and the Python trace module

https://docs.python.org/2/library/trace.html
https://docs.python.org/2/library/pdb.html

which you could modify Certbot’s source code to use, for example adding some logging information about the flow of execution, or dropping into an interactive Python shell at a particular place in the program’s execution flow. (We have indeed used tools like pdb internally in the course of developing Certbot, to examine exactly what Certbot thought was going on at particular moments when its behavior didn’t match what we expected.)

Certbot is completely free and open source software and its source code is available at

If you install Certbot via another method, you also do have a version of the Python code present in .py files somewhere on your system (where it’s located depends on how you installed Certbot).

  • The Certbot option--debug-challenges, which pauses for user input after setting up an ACME challenge. You can then look at what Certbot has done to see if you think it’s correct. (This doesn’t offer perform “debugging” in the software development sense, but it’s very helpful for figuring out problems related to certificate issuance.)

#6

If you’re using the paid version of IntelliJ you can install the official Python plug-in if it isn’t already installed. (The free version doesn’t do Python but there is a free version of PyCharm, which is a Python-specific version of IntelliJ.)

The only thing out of the ordinary you have to do with certbot is set the “Project SDK” (in IntelliJ) or the “Project Interpreter” (in PyCharm) to use certbot’s virtual environment directory instead of the default Python interpreter.


#7

Thank you for replying.

I am using either Intellij (the paid version) and also PyCharm and have opened up the certbot project in the IDE. I am hoping to see the instruction of how to setup to run the certbot in the manual mode as @schoen mentioned.

Btw, I am already able to run certbot locally using Docker as suggested in the doc. I am looking for the instruction of how to do it in IDE.

Thanks again.


#8

If you start Certbot with certbot --manual, it uses the manual authenticator.


#9

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