How certbot/certbot works
Certbot is a command-line client that obtains and maintains HTTPS certificates through ACME. The main workflow configures a request, creates or reuses an account, proves domain control through an authenticator, obtains a certificate, stores its renewable lineage, and optionally configures the web server. Renewal and certificate-management commands reuse stored lineages; Apache, nginx, webroot, standalone, and DNS plugins provide distinct deployment or validation options. The graph follows README capabilities and indexed references; some plugin and renewal implementation details were not sampled, so uncertain connections are omitted or dashed.
Main entry points: main.py CLI commands · acme/client.py ACME client · _internal/client.py Certificate client · plugins Authenticators
Components 22
Command workflow
- CLI commands
certbot/src/certbot/_internal/main.py - Configuration
certbot/src/certbot/configuration.py
ACME protocol
- ACME account
certbot/src/certbot/_internal/account.py - ACME client
acme/src/acme/client.py - Protocol messages
acme/src/acme/messages.py - Challenge types
acme/src/acme/challenges.py - Authorization handler
certbot/src/certbot/_internal/auth_handler.py
Authenticators and installers
- Authenticators
certbot/src/certbot/_internal/plugins - Apache plugin
certbot/src/certbot/_internal/plugins/apache/configurator.py - nginx plugin
certbot/src/certbot/_internal/plugins/nginx/configurator.py - DNS plugins
certbot-dns-cloudflare/src/certbot_dns_cloudflare/_internal/dns_cloudflare.py - Web server installers
certbot/src/certbot/_internal/plugins
Certificate lifecycle
- Certificate client
certbot/src/certbot/_internal/client.py - Renewal
certbot/src/certbot/_internal/renewal.py - Certificate management
certbot/src/certbot/_internal/cert_manager.py - Lineage storage
certbot/src/certbot/_internal/storage.py - Certificate crypto
certbot/src/certbot/crypto_util.py - Config rollback
certbot/src/certbot/reverter.py
Shared runtime
- Secure filesystem
certbot/src/certbot/compat/filesystem.py
Other components
- Operator
- ACME certificate authority
- Web server
Connections 28
- Operator → CLI commands: runs commands
README.rst - CLI commands → Configuration: loads settings
certbot/src/certbot/_internal/main.py - CLI commands → ACME account: uses account
certbot/src/certbot/_internal/main.py - CLI commands → Certificate client: initializes client
certbot/src/certbot/_internal/main.py - CLI commands → Certificate management: manages certificates
certbot/src/certbot/_internal/main.py - CLI commands → Renewal: runs renewal
certbot/src/certbot/_internal/main.py - ACME account → ACME client: uses protocol
certbot/src/certbot/_internal/account.py - ACME account → Protocol messages: uses messages
certbot/src/certbot/_internal/account.py - ACME client → Protocol messages: encodes messages
acme/src/acme/client.py - ACME client → Challenge types: uses challenges
acme/src/acme/client.py - ACME client → ACME certificate authority: sends ACME requests
README.rst - Authorization handler → ACME client: polls authorizations
certbot/src/certbot/_internal/auth_handler.py - Authorization handler → Authenticators: dispatches challenges
certbot/src/certbot/_internal/auth_handler.py - Authorization handler → Challenge types: selects challenge types
certbot/src/certbot/_internal/auth_handler.py - Authenticators → Apache plugin: includes
- Authenticators → nginx plugin: includes
- Authenticators → DNS plugins: includes
- Certificate client → Authorization handler: handles authorization
- Certificate client → ACME client: requests certificates
- Certificate client → Certificate crypto: creates key material
- Certificate client → Lineage storage: stores lineage
- Renewal → Lineage storage: reads lineage
certbot/src/certbot/_internal/storage.py - Certificate management → Lineage storage: deletes lineage
certbot/src/certbot/_internal/cert_manager.py - CLI commands → Web server installers: selects configurator
certbot/src/certbot/_internal/main.py - Web server installers → Web server: configures server
README.rst - Web server installers → Config rollback: records changes
- Lineage storage → Secure filesystem: uses safe file operations
certbot/src/certbot/_internal/storage.py - Certificate crypto → Secure filesystem: uses safe file operations
certbot/src/certbot/crypto_util.py