'\" t .\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "CERTBOT" "7" "Feb 09, 2024" "2.9" "Certbot" .SH NAME certbot \- Certbot Documentation .SH INTRODUCTION .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 To get started quickly, use the \fI\%interactive installation guide\fP\&. .UNINDENT .UNINDENT [image: EFF Certbot Logo] [image] .sp Certbot is part of EFF’s effort to encrypt the entire Internet. Secure communication over the Web relies on HTTPS, which requires the use of a digital certificate that lets browsers verify the identity of web servers (e.g., is that really google.com?). Web servers obtain their certificates from trusted third parties called certificate authorities (CAs). Certbot is an easy\-to\-use client that fetches a certificate from Let’s Encrypt—an open certificate authority launched by the EFF, Mozilla, and others—and deploys it to a web server. .sp Anyone who has gone through the trouble of setting up a secure website knows what a hassle getting and maintaining a certificate is. Certbot and Let’s Encrypt can automate away the pain and let you turn on and manage HTTPS with simple commands. Using Certbot and Let\(aqs Encrypt is free. .SS Getting Started .sp The best way to get started is to use our \fI\%interactive guide\fP\&. It generates instructions based on your configuration settings. In most cases, you’ll need \fI\%root or administrator access\fP to your web server to run Certbot. .sp Certbot is meant to be run directly on your web server on the command line, not on your personal computer. If you’re using a hosted service and don’t have direct access to your web server, you might not be able to use Certbot. Check with your hosting provider for documentation about uploading certificates or using certificates issued by Let’s Encrypt. .SS Contributing .sp If you\(aqd like to contribute to this project please read \fI\%Developer Guide\fP\&. .sp This project is governed by \fI\%EFF\(aqs Public Projects Code of Conduct\fP\&. .SS Links .sp Documentation: \fI\%https://certbot.eff.org/docs\fP .sp Software project: \fI\%https://github.com/certbot/certbot\fP .sp Changelog: \fI\%https://github.com/certbot/certbot/blob/master/certbot/CHANGELOG.md\fP .sp For Contributors: \fI\%https://certbot.eff.org/docs/contributing.html\fP .sp For Users: \fI\%https://certbot.eff.org/docs/using.html\fP .sp Main Website: \fI\%https://certbot.eff.org\fP .sp Let\(aqs Encrypt Website: \fI\%https://letsencrypt.org\fP .sp Community: \fI\%https://community.letsencrypt.org\fP .sp ACME spec: \fI\%RFC 8555\fP .sp ACME working area in github (archived): \fI\%https://github.com/ietf\-wg\-acme/acme\fP .SH WHAT IS A CERTIFICATE? .sp A public key or digital \fIcertificate\fP (formerly called an SSL certificate) uses a public key and a private key to enable secure communication between a client program (web browser, email client, etc.) and a server over an encrypted SSL (secure socket layer) or TLS (transport layer security) connection. The certificate is used both to encrypt the initial stage of communication (secure key exchange) and to identify the server. The certificate includes information about the key, information about the server identity, and the digital signature of the certificate issuer. If the issuer is trusted by the software that initiates the communication, and the signature is valid, then the key can be used to communicate securely with the server identified by the certificate. Using a certificate is a good way to prevent \(dqman\-in\-the\-middle\(dq attacks, in which someone in between you and the server you think you are talking to is able to insert their own (harmful) content. .sp You can use Certbot to easily obtain and configure a free certificate from Let\(aqs Encrypt, a joint project of EFF, Mozilla, and many other sponsors. .SS Certificates and Lineages .sp Certbot introduces the concept of a \fIlineage,\fP which is a collection of all the versions of a certificate plus Certbot configuration information maintained for that certificate from renewal to renewal. Whenever you renew a certificate, Certbot keeps the same configuration unless you explicitly change it, for example by adding or removing domains. If you add domains, you can either add them to an existing lineage or create a new one. .sp See also: \fI\%Re\-creating and Updating Existing Certificates\fP .SH GET CERTBOT .SS Table of Contents .INDENT 0.0 .IP \(bu 2 \fI\%System Requirements\fP .IP \(bu 2 \fI\%Installation\fP .IP \(bu 2 \fI\%Snap (Recommended)\fP .IP \(bu 2 \fI\%Alternative 1: Docker\fP .IP \(bu 2 \fI\%Alternative 2: Pip\fP .IP \(bu 2 \fI\%Alternative 3: Third Party Distributions\fP .IP \(bu 2 \fI\%Certbot\-Auto [Deprecated]\fP .UNINDENT .SS System Requirements .INDENT 0.0 .IP \(bu 2 Linux, macOS, BSD and Windows .IP \(bu 2 Recommended root access on Linux/BSD/Required Administrator access on Windows .IP \(bu 2 Port 80 Open .UNINDENT .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 Certbot is most useful when run with root privileges, because it is then able to automatically configure TLS/SSL for Apache and nginx. .sp \fICertbot is meant to be run directly on a web server\fP, normally by a system administrator. In most cases, running Certbot on your personal computer is not a useful option. The instructions below relate to installing and running Certbot on a server. .UNINDENT .UNINDENT .SS Installation .sp Unless you have very specific requirements, we kindly suggest that you use the installation instructions for your system found at \fI\%https://certbot.eff.org/instructions\fP\&. .SS Snap (Recommended) .sp Our instructions are the same across all systems that use Snap. You can find instructions for installing Certbot through Snap can be found at \fI\%https://certbot.eff.org/instructions\fP by selecting your server software and then choosing \(dqsnapd\(dq in the \(dqSystem\(dq dropdown menu. .sp Most modern Linux distributions (basically any that use systemd) can install Certbot packaged as a snap. Snaps are available for x86_64, ARMv7 and ARMv8 architectures. The Certbot snap provides an easy way to ensure you have the latest version of Certbot with features like automated certificate renewal preconfigured. .sp If you unable to use snaps, you can use an alternate method for installing \fBcertbot\fP\&. .SS Alternative 1: Docker .sp \fI\%Docker\fP is an amazingly simple and quick way to obtain a certificate. However, this mode of operation is unable to install certificates or configure your webserver, because our installer plugins cannot reach your webserver from inside the Docker container. .sp Most users should use the instructions at \fI\%certbot.eff.org\fP\&. You should only use Docker if you are sure you know what you are doing and have a good reason to do so. .sp You should definitely read the \fI\%Where are my certificates?\fP section, in order to know how to manage the certificates manually. \fI\%Our ciphersuites page\fP provides some information about recommended ciphersuites. If none of these make much sense to you, you should definitely use the installation method recommended for your system at \fI\%certbot.eff.org\fP, which enables you to use installer plugins that cover both of those hard topics. .sp If you\(aqre still not convinced and have decided to use this method, from the server that the domain you\(aqre requesting a certificate for resolves to, \fI\%install Docker\fP, then issue a command like the one found below. If you are using Certbot with the \fI\%Standalone\fP plugin, you will need to make the port it uses accessible from outside of the container by including something like \fB\-p 80:80\fP or \fB\-p 443:443\fP on the command line before \fBcertbot/certbot\fP\&. .INDENT 0.0 .INDENT 3.5 .sp .EX sudo docker run \-it \-\-rm \-\-name certbot \e \-v \(dq/etc/letsencrypt:/etc/letsencrypt\(dq \e \-v \(dq/var/lib/letsencrypt:/var/lib/letsencrypt\(dq \e certbot/certbot certonly .EE .UNINDENT .UNINDENT .sp Running Certbot with the \fBcertonly\fP command will obtain a certificate and place it in the directory \fB/etc/letsencrypt/live\fP on your system. Because Certonly cannot install the certificate from within Docker, you must install the certificate manually according to the procedure recommended by the provider of your webserver. .sp There are also Docker images for each of Certbot\(aqs DNS plugins available at \fI\%https://hub.docker.com/u/certbot\fP which automate doing domain validation over DNS for popular providers. To use one, just replace \fBcertbot/certbot\fP in the command above with the name of the image you want to use. For example, to use Certbot\(aqs plugin for Amazon Route 53, you\(aqd use \fBcertbot/dns\-route53\fP\&. You may also need to add flags to Certbot and/or mount additional directories to provide access to your DNS API credentials as specified in the \fI\%DNS plugin documentation\fP\&. .sp For more information about the layout of the \fB/etc/letsencrypt\fP directory, see \fI\%Where are my certificates?\fP\&. .SS Alternative 2: Pip .sp Installing Certbot through pip is only supported on a best effort basis and when using a virtual environment. Instructions for installing Certbot through pip can be found at \fI\%https://certbot.eff.org/instructions\fP by selecting your server software and then choosing \(dqpip\(dq in the \(dqSystem\(dq dropdown menu. .SS Alternative 3: Third Party Distributions .sp Third party distributions exist for other specific needs. They often are maintained by these parties outside of Certbot and tend to rapidly fall out of date on LTS\-style distributions. .SS Certbot\-Auto [Deprecated] .sp We used to have a shell script named \fBcertbot\-auto\fP to help people install Certbot on UNIX operating systems, however, this script is no longer supported. .sp Please remove \fBcertbot\-auto\fP\&. To do so, you need to do three things: .INDENT 0.0 .IP 1. 3 If you added a cron job or systemd timer to automatically run certbot\-auto to renew your certificates, you should delete it. If you did this by following our instructions, you can delete the entry added to \fB/etc/crontab\fP by running a command like \fBsudo sed \-i \(aq/certbot\-auto/d\(aq /etc/crontab\fP\&. .IP 2. 3 Delete the certbot\-auto script. If you placed it in \fB/usr/local/bin\(ga\fP like we recommended, you can delete it by running \fBsudo rm /usr/local/bin/certbot\-auto\fP\&. .IP 3. 3 Delete the Certbot installation created by certbot\-auto by running \fBsudo rm \-rf /opt/eff.org\fP\&. .UNINDENT .SH USER GUIDE .SS Table of Contents .INDENT 0.0 .IP \(bu 2 \fI\%Certbot Commands\fP .IP \(bu 2 \fI\%Getting certificates (and choosing plugins)\fP .INDENT 2.0 .IP \(bu 2 \fI\%Apache\fP .IP \(bu 2 \fI\%Webroot\fP .IP \(bu 2 \fI\%Nginx\fP .IP \(bu 2 \fI\%Standalone\fP .IP \(bu 2 \fI\%DNS Plugins\fP .IP \(bu 2 \fI\%Manual\fP .IP \(bu 2 \fI\%Combining plugins\fP .IP \(bu 2 \fI\%Third\-party plugins\fP .UNINDENT .IP \(bu 2 \fI\%Managing certificates\fP .INDENT 2.0 .IP \(bu 2 \fI\%Re\-creating and Updating Existing Certificates\fP .IP \(bu 2 \fI\%Changing a Certificate\(aqs Domains\fP .IP \(bu 2 \fI\%RSA and ECDSA keys\fP .INDENT 2.0 .IP \(bu 2 \fI\%Changing a certificate\(aqs key type\fP .UNINDENT .IP \(bu 2 \fI\%Revoking certificates\fP .INDENT 2.0 .IP \(bu 2 \fI\%Revoking by account key or certificate private key\fP .UNINDENT .IP \(bu 2 \fI\%Deleting certificates\fP .INDENT 2.0 .IP \(bu 2 \fI\%Safely deleting certificates\fP .UNINDENT .IP \(bu 2 \fI\%Renewing certificates\fP .IP \(bu 2 \fI\%Modifying the Renewal Configuration of Existing Certificates\fP .INDENT 2.0 .IP \(bu 2 \fI\%Certbot v2.3.0 and newer\fP .IP \(bu 2 \fI\%Certbot v2.2.0 and older\fP .UNINDENT .IP \(bu 2 \fI\%Automated Renewals\fP .INDENT 2.0 .IP \(bu 2 \fI\%Setting up automated renewal\fP .UNINDENT .UNINDENT .IP \(bu 2 \fI\%Where are my certificates?\fP .IP \(bu 2 \fI\%Pre and Post Validation Hooks\fP .IP \(bu 2 \fI\%Changing the ACME Server\fP .IP \(bu 2 \fI\%Lock Files\fP .IP \(bu 2 \fI\%Configuration file\fP .IP \(bu 2 \fI\%Log Rotation\fP .IP \(bu 2 \fI\%Certbot command\-line options\fP .IP \(bu 2 \fI\%Getting help\fP .UNINDENT .SS Certbot Commands .sp Certbot uses a number of different commands (also referred to as \(dqsubcommands\(dq) to request specific actions such as obtaining, renewing, or revoking certificates. The most important and commonly\-used commands will be discussed throughout this document; an exhaustive list also appears near the end of the document. .sp The \fBcertbot\fP script on your web server might be named \fBletsencrypt\fP if your system uses an older package. Throughout the docs, whenever you see \fBcertbot\fP, swap in the correct name as needed. .SS Getting certificates (and choosing plugins) .sp Certbot helps you achieve two tasks: .INDENT 0.0 .IP 1. 3 Obtaining a certificate: automatically performing the required authentication steps to prove that you control the domain(s), saving the certificate to \fB/etc/letsencrypt/live/\fP and renewing it on a regular schedule. .IP 2. 3 Optionally, installing that certificate to supported web servers (like Apache or nginx) and other kinds of servers. This is done by automatically modifying the configuration of your server in order to use the certificate. .UNINDENT .sp To obtain a certificate and also install it, use the \fBcertbot run\fP command (or \fBcertbot\fP, which is the same). .sp To just obtain the certificate without installing it anywhere, the \fBcertbot certonly\fP (\(dqcertificate only\(dq) command can be used. .sp Some example ways to use Certbot: .INDENT 0.0 .INDENT 3.5 .sp .EX # Obtain and install a certificate: certbot # Obtain a certificate but don\(aqt install it: certbot certonly # You may specify multiple domains with \-d and obtain and # install different certificates by running Certbot multiple times: certbot certonly \-d example.com \-d www.example.com certbot certonly \-d app.example.com \-d api.example.com .EE .UNINDENT .UNINDENT .sp To perform these tasks, Certbot will ask you to choose from a selection of authenticator and installer plugins. The appropriate choice of plugins will depend on what kind of server software you are running and plan to use your certificates with. .sp \fBAuthenticators\fP are plugins which automatically perform the required steps to prove that you control the domain names you\(aqre trying to request a certificate for. An authenticator is always required to obtain a certificate. .sp \fBInstallers\fP are plugins which can automatically modify your web server\(aqs configuration to serve your website over HTTPS, using the certificates obtained by Certbot. An installer is only required if you want Certbot to install the certificate to your web server. .sp Some plugins are both authenticators and installers and it is possible to specify a distinct \fI\%combination\fP of authenticator and plugin. .TS center; |l|l|l|l|l|. _ T{ Plugin T} T{ Auth T} T{ Inst T} T{ Notes T} T{ Challenge types (and port) T} _ T{ \fI\%apache\fP T} T{ Y T} T{ Y T} T{ .nf Automates obtaining and installing a certificate with Apache. .fi T} T{ \fI\%http\-01\fP (80) T} _ T{ \fI\%nginx\fP T} T{ Y T} T{ Y T} T{ .nf Automates obtaining and installing a certificate with Nginx. .fi T} T{ \fI\%http\-01\fP (80) T} _ T{ \fI\%webroot\fP T} T{ Y T} T{ N T} T{ .nf Obtains a certificate by writing to the webroot directory of an already running webserver. .fi T} T{ \fI\%http\-01\fP (80) T} _ T{ \fI\%standalone\fP T} T{ Y T} T{ N T} T{ .nf Uses a \(dqstandalone\(dq webserver to obtain a certificate. Requires port 80 to be available. This is useful on systems with no webserver, or when direct integration with the local webserver is not supported or not desired. .fi T} T{ \fI\%http\-01\fP (80) T} _ T{ \fI\%DNS plugins\fP T} T{ Y T} T{ N T} T{ .nf This category of plugins automates obtaining a certificate by modifying DNS records to prove you have control over a domain. Doing domain validation in this way is the only way to obtain wildcard certificates from Let\(aqs Encrypt. .fi T} T{ \fI\%dns\-01\fP (53) T} _ T{ \fI\%manual\fP T} T{ Y T} T{ N T} T{ .nf Obtain a certificate by manually following instructions to perform domain validation yourself. Certificates created this way do not support autorenewal. Autorenewal may be enabled by providing an authentication hook script to automate the domain validation steps. .fi T} T{ \fI\%http\-01\fP (80) or \fI\%dns\-01\fP (53) T} _ .TE .sp Under the hood, plugins use one of several ACME protocol \fI\%challenges\fP to prove you control a domain. The options are \fI\%http\-01\fP (which uses port 80) and \fI\%dns\-01\fP (requiring configuration of a DNS server on port 53, though that\(aqs often not the same machine as your webserver). A few plugins support more than one challenge type, in which case you can choose one with \fB\-\-preferred\-challenges\fP\&. .sp There are also many \fI\%third\-party\-plugins\fP available. Below we describe in more detail the circumstances in which each plugin can be used, and how to use it. .SS Apache .sp The Apache plugin currently \fI\%supports\fP modern OSes based on Debian, Fedora, SUSE, Gentoo, CentOS and Darwin. This automates both obtaining \fIand\fP installing certificates on an Apache webserver. To specify this plugin on the command line, simply include \fB\-\-apache\fP\&. .SS Webroot .sp If you\(aqre running a local webserver for which you have the ability to modify the content being served, and you\(aqd prefer not to stop the webserver during the certificate issuance process, you can use the webroot plugin to obtain a certificate by including \fBcertonly\fP and \fB\-\-webroot\fP on the command line. In addition, you\(aqll need to specify \fB\-\-webroot\-path\fP or \fB\-w\fP with the top\-level directory (\(dqweb root\(dq) containing the files served by your webserver. For example, \fB\-\-webroot\-path /var/www/html\fP or \fB\-\-webroot\-path /usr/share/nginx/html\fP are two common webroot paths. .sp If you\(aqre getting a certificate for many domains at once, the plugin needs to know where each domain\(aqs files are served from, which could potentially be a separate directory for each domain. When requesting a certificate for multiple domains, each domain will use the most recently specified \fB\-\-webroot\-path\fP\&. So, for instance, .INDENT 0.0 .INDENT 3.5 .sp .EX certbot certonly \-\-webroot \-w /var/www/example \-d www.example.com \-d example.com \-w /var/www/other \-d other.example.net \-d another.other.example.net .EE .UNINDENT .UNINDENT .sp would obtain a single certificate for all of those names, using the \fB/var/www/example\fP webroot directory for the first two, and \fB/var/www/other\fP for the second two. .sp The webroot plugin works by creating a temporary file for each of your requested domains in \fB${webroot\-path}/.well\-known/acme\-challenge\fP\&. Then the Let\(aqs Encrypt validation server makes HTTP requests to validate that the DNS for each requested domain resolves to the server running certbot. An example request made to your web server would look like: .INDENT 0.0 .INDENT 3.5 .sp .EX 66.133.109.36 \- \- [05/Jan/2016:20:11:24 \-0500] \(dqGET /.well\-known/acme\-challenge/HGr8U1IeTW4kY_Z6UIyaakzOkyQgPr_7ArlLgtZE8SX HTTP/1.1\(dq 200 87 \(dq\-\(dq \(dqMozilla/5.0 (compatible; Let\(aqs Encrypt validation server; +https://www.letsencrypt.org)\(dq .EE .UNINDENT .UNINDENT .sp Note that to use the webroot plugin, your server must be configured to serve files from hidden directories. If \fB/.well\-known\fP is treated specially by your webserver configuration, you might need to modify the configuration to ensure that files inside \fB/.well\-known/acme\-challenge\fP are served by the webserver. .sp Under Windows, Certbot will generate a \fBweb.config\fP file, if one does not already exist, in \fB/.well\-known/acme\-challenge\fP in order to let IIS serve the challenge files even if they do not have an extension. .SS Nginx .sp The Nginx plugin should work for most configurations. We recommend backing up Nginx configurations before using it (though you can also revert changes to configurations with \fBcertbot \-\-nginx rollback\fP). You can use it by providing the \fB\-\-nginx\fP flag on the commandline. .INDENT 0.0 .INDENT 3.5 .sp .EX certbot \-\-nginx .EE .UNINDENT .UNINDENT .SS Standalone .sp Use standalone mode to obtain a certificate if you don\(aqt want to use (or don\(aqt currently have) existing server software. The standalone plugin does not rely on any other server software running on the machine where you obtain the certificate. .sp To obtain a certificate using a \(dqstandalone\(dq webserver, you can use the standalone plugin by including \fBcertonly\fP and \fB\-\-standalone\fP on the command line. This plugin needs to bind to port 80 in order to perform domain validation, so you may need to stop your existing webserver. .sp It must still be possible for your machine to accept inbound connections from the Internet on the specified port using each requested domain name. .sp By default, Certbot first attempts to bind to the port for all interfaces using IPv6 and then bind to that port using IPv4; Certbot continues so long as at least one bind succeeds. On most Linux systems, IPv4 traffic will be routed to the bound IPv6 port and the failure during the second bind is expected. .sp Use \fB\-\-\-address\fP to explicitly tell Certbot which interface (and protocol) to bind. .SS DNS Plugins .sp If you\(aqd like to obtain a wildcard certificate from Let\(aqs Encrypt or run \fBcertbot\fP on a machine other than your target webserver, you can use one of Certbot\(aqs DNS plugins. .sp These plugins are not included in a default Certbot installation and must be installed separately. They are available in many OS package managers, as Docker images, and as snaps. Visit \fI\%https://certbot.eff.org\fP to learn the best way to use the DNS plugins on your system. .sp Once installed, you can find documentation on how to use each plugin at: .INDENT 0.0 .IP \(bu 2 \fI\%certbot\-dns\-cloudflare\fP .IP \(bu 2 \fI\%certbot\-dns\-digitalocean\fP .IP \(bu 2 \fI\%certbot\-dns\-dnsimple\fP .IP \(bu 2 \fI\%certbot\-dns\-dnsmadeeasy\fP .IP \(bu 2 \fI\%certbot\-dns\-gehirn\fP .IP \(bu 2 \fI\%certbot\-dns\-google\fP .IP \(bu 2 \fI\%certbot\-dns\-linode\fP .IP \(bu 2 \fI\%certbot\-dns\-luadns\fP .IP \(bu 2 \fI\%certbot\-dns\-nsone\fP .IP \(bu 2 \fI\%certbot\-dns\-ovh\fP .IP \(bu 2 \fI\%certbot\-dns\-rfc2136\fP .IP \(bu 2 \fI\%certbot\-dns\-route53\fP .IP \(bu 2 \fI\%certbot\-dns\-sakuracloud\fP .UNINDENT .SS Manual .sp If you\(aqd like to obtain a certificate running \fBcertbot\fP on a machine other than your target webserver or perform the steps for domain validation yourself, you can use the manual plugin. While hidden from the UI, you can use the plugin to obtain a certificate by specifying \fBcertonly\fP and \fB\-\-manual\fP on the command line. This requires you to copy and paste commands into another terminal session, which may be on a different computer. .sp The manual plugin can use either the \fBhttp\fP or the \fBdns\fP challenge. You can use the \fB\-\-preferred\-challenges\fP option to choose the challenge of your preference. .sp The \fBhttp\fP challenge will ask you to place a file with a specific name and specific content in the \fB/.well\-known/acme\-challenge/\fP directory directly in the top\-level directory (“web root”) containing the files served by your webserver. In essence it\(aqs the same as the \fI\%webroot\fP plugin, but not automated. .sp When using the \fBdns\fP challenge, \fBcertbot\fP will ask you to place a TXT DNS record with specific contents under the domain name consisting of the hostname for which you want a certificate issued, prepended by \fB_acme\-challenge\fP\&. .sp For example, for the domain \fBexample.com\fP, a zone file entry would look like: .INDENT 0.0 .INDENT 3.5 .sp .EX _acme\-challenge.example.com. 300 IN TXT \(dqgfj9Xq...Rg85nM\(dq .EE .UNINDENT .UNINDENT .sp \fBRenewal with the manual plugin\fP .sp Certificates created using \fB\-\-manual\fP \fBdo not\fP support automatic renewal unless combined with an \fI\%authentication hook script\fP via \fB\-\-manual\-auth\-hook\fP to automatically set up the required HTTP and/or TXT challenges. .sp If you can use one of the other \fI\%plugins\fP which support autorenewal to create your certificate, doing so is highly recommended. .sp To manually renew a certificate using \fB\-\-manual\fP without hooks, repeat the same \fBcertbot \-\-manual\fP command you used to create the certificate originally. As this will require you to copy and paste new HTTP files or DNS TXT records, the command cannot be automated with a cron job. .SS Combining plugins .sp Sometimes you may want to specify a combination of distinct authenticator and installer plugins. To do so, specify the authenticator plugin with \fB\-\-authenticator\fP or \fB\-a\fP and the installer plugin with \fB\-\-installer\fP or \fB\-i\fP\&. .sp For instance, you could create a certificate using the \fI\%webroot\fP plugin for authentication and the \fI\%apache\fP plugin for installation. .INDENT 0.0 .INDENT 3.5 .sp .EX certbot run \-a webroot \-i apache \-w /var/www/html \-d example.com .EE .UNINDENT .UNINDENT .sp Or you could create a certificate using the \fI\%manual\fP plugin for authentication and the \fI\%nginx\fP plugin for installation. (Note that this certificate cannot be renewed automatically.) .INDENT 0.0 .INDENT 3.5 .sp .EX certbot run \-a manual \-i nginx \-d example.com .EE .UNINDENT .UNINDENT .SS Third\-party plugins .sp There are also a number of third\-party plugins for the client, provided by other developers. Many are beta/experimental, but some are already in widespread use: .TS center; |l|l|l|l|. _ T{ Plugin T} T{ Auth T} T{ Inst T} T{ Notes T} _ T{ \fI\%haproxy\fP T} T{ Y T} T{ Y T} T{ Integration with the HAProxy load balancer T} _ T{ \fI\%s3front\fP T} T{ Y T} T{ Y T} T{ Integration with Amazon CloudFront distribution of S3 buckets T} _ T{ \fI\%gandi\fP T} T{ Y T} T{ N T} T{ Obtain certificates via the Gandi LiveDNS API T} _ T{ \fI\%varnish\fP T} T{ Y T} T{ N T} T{ Obtain certificates via a Varnish server T} _ T{ \fI\%external\-auth\fP T} T{ Y T} T{ Y T} T{ A plugin for convenient scripting T} _ T{ \fI\%pritunl\fP T} T{ N T} T{ Y T} T{ Install certificates in pritunl distributed OpenVPN servers T} _ T{ \fI\%proxmox\fP T} T{ N T} T{ Y T} T{ Install certificates in Proxmox Virtualization servers T} _ T{ \fI\%dns\-standalone\fP T} T{ Y T} T{ N T} T{ Obtain certificates via an integrated DNS server T} _ T{ \fI\%dns\-ispconfig\fP T} T{ Y T} T{ N T} T{ DNS Authentication using ISPConfig as DNS server T} _ T{ \fI\%dns\-clouddns\fP T} T{ Y T} T{ N T} T{ DNS Authentication using CloudDNS API T} _ T{ \fI\%dns\-lightsail\fP T} T{ Y T} T{ N T} T{ DNS Authentication using Amazon Lightsail DNS API T} _ T{ \fI\%dns\-inwx\fP T} T{ Y T} T{ Y T} T{ DNS Authentication for INWX through the XML API T} _ T{ \fI\%dns\-azure\fP T} T{ Y T} T{ N T} T{ DNS Authentication using Azure DNS T} _ T{ \fI\%dns\-godaddy\fP T} T{ Y T} T{ N T} T{ DNS Authentication using Godaddy DNS T} _ T{ \fI\%dns\-yandexcloud\fP T} T{ Y T} T{ N T} T{ DNS Authentication using Yandex Cloud DNS T} _ T{ \fI\%dns\-bunny\fP T} T{ Y T} T{ N T} T{ DNS Authentication using BunnyDNS T} _ T{ \fI\%njalla\fP T} T{ Y T} T{ N T} T{ DNS Authentication for njalla T} _ T{ \fI\%DuckDNS\fP T} T{ Y T} T{ N T} T{ DNS Authentication for DuckDNS T} _ T{ \fI\%Porkbun\fP T} T{ Y T} T{ N T} T{ DNS Authentication for Porkbun T} _ T{ \fI\%Infomaniak\fP T} T{ Y T} T{ N T} T{ DNS Authentication using Infomaniak Domains API T} _ T{ \fI\%dns\-multi\fP T} T{ Y T} T{ N T} T{ DNS authentication of 100+ providers using go\-acme/lego T} _ T{ \fI\%dns\-dnsmanager\fP T} T{ Y T} T{ N T} T{ DNS Authentication for dnsmanager.io T} _ T{ \fI\%standalone\-nfq\fP T} T{ Y T} T{ N T} T{ HTTP Authentication that works with any webserver (Linux only) T} _ T{ \fI\%dns\-solidserver\fP T} T{ Y T} T{ N T} T{ DNS Authentication using SOLIDserver (EfficientIP) T} _ T{ \fI\%dns\-stackit\fP T} T{ Y T} T{ N T} T{ DNS Authentication using STACKIT DNS T} _ .TE .sp If you\(aqre interested, you can also \fI\%write your own plugin\fP\&. .SS Managing certificates .sp To view a list of the certificates Certbot knows about, run the \fBcertificates\fP subcommand: .sp \fBcertbot certificates\fP .sp This returns information in the following format: .INDENT 0.0 .INDENT 3.5 .sp .EX Found the following certificates: Certificate Name: example.com Domains: example.com, www.example.com Expiry Date: 2017\-02\-19 19:53:00+00:00 (VALID: 30 days) Certificate Path: /etc/letsencrypt/live/example.com/fullchain.pem Key Type: RSA Private Key Path: /etc/letsencrypt/live/example.com/privkey.pem .EE .UNINDENT .UNINDENT .sp \fBCertificate Name\fP shows the name of the certificate. Pass this name using the \fB\-\-cert\-name\fP flag to specify a particular certificate for the \fBrun\fP, \fBcertonly\fP, \fBcertificates\fP, \fBrenew\fP, and \fBdelete\fP commands. The certificate name cannot contain filepath separators (i.e. \(aq/\(aq or \(aq\e\(aq, depending on the platform). Example: .INDENT 0.0 .INDENT 3.5 .sp .EX certbot certonly \-\-cert\-name example.com .EE .UNINDENT .UNINDENT .SS Re\-creating and Updating Existing Certificates .sp You can use \fBcertonly\fP or \fBrun\fP subcommands to request the creation of a single new certificate even if you already have an existing certificate with some of the same domain names. .sp If a certificate is requested with \fBrun\fP or \fBcertonly\fP specifying a certificate name that already exists, Certbot updates the existing certificate. Otherwise a new certificate is created and assigned the specified name. .sp The \fB\-\-force\-renewal\fP, \fB\-\-duplicate\fP, and \fB\-\-expand\fP options control Certbot\(aqs behavior when re\-creating a certificate with the same name as an existing certificate. If you don\(aqt specify a requested behavior, Certbot may ask you what you intended. .sp \fB\-\-force\-renewal\fP tells Certbot to request a new certificate with the same domains as an existing certificate. Each domain must be explicitly specified via \fB\-d\fP\&. If successful, this certificate is saved alongside the earlier one and symbolic links (the \(dq\fBlive\fP\(dq reference) will be updated to point to the new certificate. This is a valid method of renewing a specific individual certificate. .sp \fB\-\-duplicate\fP tells Certbot to create a separate, unrelated certificate with the same domains as an existing certificate. This certificate is saved completely separately from the prior one. Most users will not need to issue this command in normal circumstances. .sp \fB\-\-expand\fP tells Certbot to update an existing certificate with a new certificate that contains all of the old domains and one or more additional new domains. With the \fB\-\-expand\fP option, use the \fB\-d\fP option to specify all existing domains and one or more new domains. .sp Example: .INDENT 0.0 .INDENT 3.5 .sp .EX certbot \-\-expand \-d existing.com,example.com,newdomain.com .EE .UNINDENT .UNINDENT .sp If you prefer, you can specify the domains individually like this: .INDENT 0.0 .INDENT 3.5 .sp .EX certbot \-\-expand \-d existing.com \-d example.com \-d newdomain.com .EE .UNINDENT .UNINDENT .sp Consider using \fB\-\-cert\-name\fP instead of \fB\-\-expand\fP, as it gives more control over which certificate is modified and it lets you remove domains as well as adding them. .sp \fB\-\-allow\-subset\-of\-names\fP tells Certbot to continue with certificate generation if only some of the specified domain authorizations can be obtained. This may be useful if some domains specified in a certificate no longer point at this system. .sp Whenever you obtain a new certificate in any of these ways, the new certificate exists alongside any previously obtained certificates, whether or not the previous certificates have expired. The generation of a new certificate counts against several rate limits that are intended to prevent abuse of the ACME protocol, as described \fI\%here\fP\&. .SS Changing a Certificate\(aqs Domains .sp The \fB\-\-cert\-name\fP flag can also be used to modify the domains a certificate contains, by specifying new domains using the \fB\-d\fP or \fB\-\-domains\fP flag. If certificate \fBexample.com\fP previously contained \fBexample.com\fP and \fBwww.example.com\fP, it can be modified to only contain \fBexample.com\fP by specifying only \fBexample.com\fP with the \fB\-d\fP or \fB\-\-domains\fP flag. Example: .INDENT 0.0 .INDENT 3.5 .sp .EX certbot certonly \-\-cert\-name example.com \-d example.com .EE .UNINDENT .UNINDENT .sp The same format can be used to expand the set of domains a certificate contains, or to replace that set entirely: .INDENT 0.0 .INDENT 3.5 .sp .EX certbot certonly \-\-cert\-name example.com \-d example.org,www.example.org .EE .UNINDENT .UNINDENT .SS RSA and ECDSA keys .sp Certbot supports two certificate private key algorithms: \fBrsa\fP and \fBecdsa\fP\&. .sp As of version 2.0.0, Certbot defaults to ECDSA \fBsecp256r1\fP (P\-256) certificate private keys for all new certificates. Existing certificates will continue to renew using their existing key type, unless a key type change is requested. .sp The type of key used by Certbot can be controlled through the \fB\-\-key\-type\fP option. You can use the \fB\-\-elliptic\-curve\fP option to control the curve used in ECDSA certificates and the \fB\-\-rsa\-key\-size\fP option to control the size of RSA keys. .sp \fBWARNING:\fP .INDENT 0.0 .INDENT 3.5 If you obtain certificates using ECDSA keys, you should be careful not to downgrade to a Certbot version earlier than 1.10.0 where ECDSA keys were not supported. Downgrades like this are possible if you switch from something like the snaps or pip to packages provided by your operating system which often lag behind. .UNINDENT .UNINDENT .SS Changing a certificate\(aqs key type .sp Unless you are aware that you need to support very old HTTPS clients that are not supported by most sites, you can safely transition your site to use ECDSA keys instead of RSA keys. .sp If you want to change a single certificate to use ECDSA keys, you\(aqll need to create or renew a certificate while setting \fB\-\-key\-type ecdsa\fP on the command line: .INDENT 0.0 .INDENT 3.5 .sp .EX certbot renew \-\-key\-type ecdsa \-\-cert\-name example.com \-\-force\-renewal .EE .UNINDENT .UNINDENT .sp If you want to use ECDSA keys for all certificates in the future (including renewals of existing certificates), you can add the following line to Certbot\(aqs \fI\%configuration file\fP: .INDENT 0.0 .INDENT 3.5 .sp .EX key\-type = ecdsa .EE .UNINDENT .UNINDENT .sp which will take effect upon the next renewal of each certificate. .SS Revoking certificates .sp If you need to revoke a certificate, use the \fBrevoke\fP subcommand to do so. .sp A certificate may be revoked by providing its name (see \fBcertbot certificates\fP) or by providing its path directly: .INDENT 0.0 .INDENT 3.5 .sp .EX certbot revoke \-\-cert\-name example.com certbot revoke \-\-cert\-path /etc/letsencrypt/live/example.com/cert.pem .EE .UNINDENT .UNINDENT .sp If the certificate being revoked was obtained via the \fB\-\-staging\fP, \fB\-\-test\-cert\fP or a non\-default \fB\-\-server\fP flag, that flag must be passed to the \fBrevoke\fP subcommand. .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 After revocation, Certbot will (by default) ask whether you want to \fBdelete\fP the certificate. Unless deleted, Certbot will try to renew revoked certificates the next time \fBcertbot renew\fP runs. .UNINDENT .UNINDENT .sp You can also specify the reason for revoking your certificate by using the \fBreason\fP flag. Reasons include \fBunspecified\fP which is the default, as well as \fBkeycompromise\fP, \fBaffiliationchanged\fP, \fBsuperseded\fP, and \fBcessationofoperation\fP: .INDENT 0.0 .INDENT 3.5 .sp .EX certbot revoke \-\-cert\-name example.com \-\-reason keycompromise .EE .UNINDENT .UNINDENT .SS Revoking by account key or certificate private key .sp By default, Certbot will try revoke the certificate using your ACME account key. If the certificate was created from the same ACME account, the revocation will be successful. .sp If you instead have the corresponding private key file to the certificate you wish to revoke, use \fB\-\-key\-path\fP to perform the revocation from any ACME account: .INDENT 0.0 .INDENT 3.5 .sp .EX certbot revoke \-\-cert\-path /etc/letsencrypt/live/example.com/cert.pem \-\-key\-path /etc/letsencrypt/live/example.com/privkey.pem .EE .UNINDENT .UNINDENT .SS Deleting certificates .sp If you need to delete a certificate, use the \fBdelete\fP subcommand. .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 Read this and the \fI\%Safely deleting certificates\fP sections carefully. This is an irreversible operation and must be done with care. .UNINDENT .UNINDENT .sp Certbot does not automatically revoke a certificate before deleting it. If you\(aqre no longer using a certificate and don\(aqt plan to use it anywhere else, you may want to follow the instructions in \fI\%Revoking certificates\fP instead. Generally, there\(aqs no need to revoke a certificate if its private key has not been compromised, but you may still receive expiration emails from Let\(aqs Encrypt unless you revoke. .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 Do not manually delete certificate files from inside \fB/etc/letsencrypt/\fP\&. Always use the \fBdelete\fP subcommand. .UNINDENT .UNINDENT .sp A certificate may be deleted by providing its name with \fB\-\-cert\-name\fP\&. You may find its name using \fBcertbot certificates\fP\&. .sp Otherwise, you will be prompted to choose one or more certificates to delete: .INDENT 0.0 .INDENT 3.5 .sp .EX certbot delete \-\-cert\-name example.com # or to choose from a list: certbot delete .EE .UNINDENT .UNINDENT .SS Safely deleting certificates .sp Deleting a certificate without following the proper steps can result in a non\-functioning server. To safely delete a certificate, follow all the steps below to make sure that references to a certificate are removed from the configuration of any installed server software (Apache, nginx, Postfix, etc) \fIbefore\fP deleting the certificate. .sp To explain further, when installing a certificate, Certbot modifies Apache or nginx\(aqs configuration to load the certificate and its private key from the \fB/etc/letsencrypt/live/\fP directory. Before deleting a certificate, it is necessary to undo that modification, by removing any references to the certificate from the webserver\(aqs configuration files. .sp Follow these steps to safely delete a certificate: .INDENT 0.0 .IP 1. 3 Find all references to the certificate (substitute \fBexample.com\fP in the command for the name of the certificate you wish to delete): .INDENT 3.0 .INDENT 3.5 .sp .EX sudo bash \-c \(aqgrep \-R live/example.com /etc/{nginx,httpd,apache2}\(aq .EE .UNINDENT .UNINDENT .sp If there are no references found, skip directly to Step 4. .sp If some references are found, they will look something like: .INDENT 3.0 .INDENT 3.5 .sp .EX /etc/apache2/sites\-available/000\-default\-le\-ssl.conf:SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem /etc/apache2/sites\-available/000\-default\-le\-ssl.conf:SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem .EE .UNINDENT .UNINDENT .IP 2. 3 You will need a self\-signed certificate to replace the certificate you are deleting. The following command will generate one for you, saving the certificate at \fB/etc/letsencrypt/self\-signed\-cert.pem\fP and its private key at \fB/etc/letsencrypt/self\-signed\-privkey.pem\fP: .INDENT 3.0 .INDENT 3.5 .sp .EX sudo openssl req \-nodes \-batch \-x509 \-newkey rsa:2048 \-keyout /etc/letsencrypt/self\-signed\-privkey.pem \-out /etc/letsencrypt/self\-signed\-cert.pem \-days 356 .EE .UNINDENT .UNINDENT .IP 3. 3 For each reference found in Step 1, open the file in a text editor and replace the reference to the existing certificate with a reference to the self\-signed certificate. .sp Continuing from the previous example, you would open \fB/etc/apache2/sites\-available/000\-default\-le\-ssl.conf\fP in a text editor and modify the two matching lines of text to instead say: .INDENT 3.0 .INDENT 3.5 .sp .EX SSLCertificateFile /etc/letsencrypt/self\-signed\-cert.pem SSLCertificateKeyFile /etc/letsencrypt/self\-signed\-privkey.pem .EE .UNINDENT .UNINDENT .IP 4. 3 It is now safe to delete the certificate. Do so by running: .INDENT 3.0 .INDENT 3.5 .sp .EX sudo certbot delete \-\-cert\-name example.com .EE .UNINDENT .UNINDENT .UNINDENT .SS Renewing certificates .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 Let\(aqs Encrypt CA issues short\-lived certificates (90 days). Make sure you renew the certificates at least once in 3 months. .UNINDENT .UNINDENT .sp \fBSEE ALSO:\fP .INDENT 0.0 .INDENT 3.5 Most Certbot installations come with automatic renewal out of the box. See \fI\%Automated Renewals\fP for more details. .UNINDENT .UNINDENT .sp \fBSEE ALSO:\fP .INDENT 0.0 .INDENT 3.5 Users of the \fI\%Manual\fP plugin should note that \fB\-\-manual\fP certificates will not renew automatically, unless combined with authentication hook scripts. See \fI\%Renewal with the manual plugin\fP\&. .UNINDENT .UNINDENT .sp As of version 0.10.0, Certbot supports a \fBrenew\fP action to check all installed certificates for impending expiry and attempt to renew them. The simplest form is simply .sp \fBcertbot renew\fP .sp This command attempts to renew any previously\-obtained certificates that expire in less than 30 days. The same plugin and options that were used at the time the certificate was originally issued will be used for the renewal attempt, unless you specify other plugins or options. Unlike \fBcertonly\fP, \fBrenew\fP acts on multiple certificates and always takes into account whether each one is near expiry. Because of this, \fBrenew\fP is suitable (and designed) for automated use, to allow your system to automatically renew each certificate when appropriate. Since \fBrenew\fP only renews certificates that are near expiry it can be run as frequently as you want \- since it will usually take no action. .sp The \fBrenew\fP command includes hooks for running commands or scripts before or after a certificate is renewed. For example, if you have a single certificate obtained using the \fI\%standalone\fP plugin, you might need to stop the webserver before renewing so standalone can bind to the necessary ports, and then restart it after the plugin is finished. Example: .INDENT 0.0 .INDENT 3.5 .sp .EX certbot renew \-\-pre\-hook \(dqservice nginx stop\(dq \-\-post\-hook \(dqservice nginx start\(dq .EE .UNINDENT .UNINDENT .sp If a hook exits with a non\-zero exit code, the error will be printed to \fBstderr\fP but renewal will be attempted anyway. A failing hook doesn\(aqt directly cause Certbot to exit with a non\-zero exit code, but since Certbot exits with a non\-zero exit code when renewals fail, a failed hook causing renewal failures will indirectly result in a non\-zero exit code. Hooks will only be run if a certificate is due for renewal, so you can run the above command frequently without unnecessarily stopping your webserver. .sp When Certbot detects that a certificate is due for renewal, \fB\-\-pre\-hook\fP and \fB\-\-post\-hook\fP hooks run before and after each attempt to renew it. If you want your hook to run only after a successful renewal, use \fB\-\-deploy\-hook\fP in a command like this. .sp \fBcertbot renew \-\-deploy\-hook /path/to/deploy\-hook\-script\fP .sp You can also specify hooks by placing files in subdirectories of Certbot\(aqs configuration directory. Assuming your configuration directory is \fB/etc/letsencrypt\fP, any executable files found in \fB/etc/letsencrypt/renewal\-hooks/pre\fP, \fB/etc/letsencrypt/renewal\-hooks/deploy\fP, and \fB/etc/letsencrypt/renewal\-hooks/post\fP will be run as pre, deploy, and post hooks respectively when any certificate is renewed with the \fBrenew\fP subcommand. These hooks are run in alphabetical order and are not run for other subcommands. (The order the hooks are run is determined by the byte value of the characters in their filenames and is not dependent on your locale.) .sp Hooks specified in the command line, \fI\%configuration file\fP, or \fI\%renewal configuration files\fP are run as usual after running all hooks in these directories. One minor exception to this is if a hook specified elsewhere is simply the path to an executable file in the hook directory of the same type (e.g. your pre\-hook is the path to an executable in \fB/etc/letsencrypt/renewal\-hooks/pre\fP), the file is not run a second time. You can stop Certbot from automatically running executables found in these directories by including \fB\-\-no\-directory\-hooks\fP on the command line. .sp More information about hooks can be found by running \fBcertbot \-\-help renew\fP\&. .sp If you\(aqre sure that this command executes successfully without human intervention, you can add the command to \fBcrontab\fP (since certificates are only renewed when they\(aqre determined to be near expiry, the command can run on a regular basis, like every week or every day). In that case, you are likely to want to use the \fB\-q\fP or \fB\-\-quiet\fP quiet flag to silence all output except errors. .sp If you are manually renewing all of your certificates, the \fB\-\-force\-renewal\fP flag may be helpful; it causes the expiration time of the certificate(s) to be ignored when considering renewal, and attempts to renew each and every installed certificate regardless of its age. (This form is not appropriate to run daily because each certificate will be renewed every day, which will quickly run into the certificate authority rate limit.) .sp Starting with Certbot 2.7.0, certbot provides the environment variables \fBRENEWED_DOMAINS\fP and \fBFAILED_DOMAINS\fP to all post renewal hooks. These variables contain a space separated list of domains. These variables can be used to determine if a renewal has succeeded or failed as part of your post renewal hook. .sp Note that options provided to \fBcertbot renew\fP will apply to \fIevery\fP certificate for which renewal is attempted; for example, \fBcertbot renew \-\-rsa\-key\-size 4096\fP would try to replace every near\-expiry certificate with an equivalent certificate using a 4096\-bit RSA public key. If a certificate is successfully renewed using specified options, those options will be saved and used for future renewals of that certificate. .sp An alternative form that provides for more fine\-grained control over the renewal process (while renewing specified certificates one at a time), is \fBcertbot certonly\fP with the complete set of subject domains of a specific certificate specified via \fB\-d\fP flags. You may also want to include the \fB\-n\fP or \fB\-\-noninteractive\fP flag to prevent blocking on user input (which is useful when running the command from cron). .sp \fBcertbot certonly \-n \-d example.com \-d www.example.com\fP .sp All of the domains covered by the certificate must be specified in this case in order to renew and replace the old certificate rather than obtaining a new one; don\(aqt forget any \fBwww.\fP domains! Specifying a subset of the domains creates a new, separate certificate containing only those domains, rather than replacing the original certificate. When run with a set of domains corresponding to an existing certificate, the \fBcertonly\fP command attempts to renew that specific certificate. .sp Please note that the CA will send notification emails to the address you provide if you do not renew certificates that are about to expire. .sp Certbot is working hard to improve the renewal process, and we apologize for any inconvenience you encounter in integrating these commands into your individual environment. .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 \fBcertbot renew\fP exit status will only be 1 if a renewal attempt failed. This means \fBcertbot renew\fP exit status will be 0 if no certificate needs to be updated. If you write a custom script and expect to run a command only after a certificate was actually renewed you will need to use the \fB\-\-deploy\-hook\fP since the exit status will be 0 both on successful renewal and when renewal is not necessary. .UNINDENT .UNINDENT .SS Modifying the Renewal Configuration of Existing Certificates .sp When creating a certificate, Certbot will keep track of all of the relevant options chosen by the user. At renewal time, Certbot will remember these options and apply them once again. .sp Sometimes, you may encounter the need to change some of these options for future certificate renewals. To achieve this, you will need to perform the following steps: .SS Certbot v2.3.0 and newer .sp The \fBcertbot reconfigure\fP command can be used to change a certificate\(aqs renewal options. This command will use the new renewal options to perform a test renewal against the Let\(aqs Encrypt staging server. If this is successful, the new renewal options will be saved and will apply to future renewals. .sp You will need to specify the \fB\-\-cert\-name\fP, which can be found by running \fBcertbot certificates\fP\&. .sp A list of common options that may be updated with the \fBreconfigure\fP command can be found by running \fBcertbot help reconfigure\fP\&. .sp As a practical example, if you were using the \fBwebroot\fP authenticator and had relocated your website to another directory, you can change the \fB\-\-webroot\-path\fP to the new directory using the following command: .INDENT 0.0 .INDENT 3.5 .sp .EX certbot reconfigure \-\-cert\-name example.com \-\-webroot\-path /path/to/new/location .EE .UNINDENT .UNINDENT .SS Certbot v2.2.0 and older .INDENT 0.0 .IP 1. 3 Perform a \fIdry run renewal\fP with the amended options on the command line. This allows you to confirm that the change is valid and will result in successful future renewals. .IP 2. 3 If the dry run is successful, perform a \fIlive renewal\fP of the certificate. This will persist the change for future renewals. If the certificate is not yet due to expire, you will need to force a renewal using \fB\-\-force\-renewal\fP\&. .UNINDENT .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 Rate limits from the certificate authority may prevent you from performing multiple renewals in a short period of time. It is strongly recommended to perform the second step only once, when you have decided on what options should change. .UNINDENT .UNINDENT .sp As a practical example, if you were using the \fBwebroot\fP authenticator and had relocated your website to another directory, you would need to change the \fB\-\-webroot\-path\fP to the new directory. Following the above advice: .INDENT 0.0 .IP 1. 3 Perform a \fIdry\-run renewal\fP of the individual certificate with the amended options: .INDENT 3.0 .INDENT 3.5 .sp .EX certbot renew \-\-cert\-name example.com \-\-webroot\-path /path/to/new/location \-\-dry\-run .EE .UNINDENT .UNINDENT .IP 2. 3 If the dry\-run was successful, make the change permanent by performing a \fIlive renewal\fP of the certificate with the amended options, including \fB\-\-force\-renewal\fP: .INDENT 3.0 .INDENT 3.5 .sp .EX certbot renew \-\-cert\-name example.com \-\-webroot\-path /path/to/new/location \-\-force\-renewal .EE .UNINDENT .UNINDENT .sp \fB\-\-cert\-name\fP selects the particular certificate to be modified. Without this option, all certificates will be selected. .sp \fB\-\-webroot\-path\fP is the option intended to be changed. All other previously selected options will be kept the same and do not need to be included in the command. .UNINDENT .sp For advanced certificate management tasks, it is also possible to manually modify the certificate\(aqs renewal configuration file, but this is discouraged since it can easily break Certbot\(aqs ability to renew your certificates. These renewal configuration files are located at \fB/etc/letsencrypt/renewal/CERTNAME.conf\fP\&. If you choose to modify the renewal configuration file we advise you to make a backup of the file beforehand and test its validity with the \fBcertbot renew \-\-dry\-run\fP command. .sp \fBWARNING:\fP .INDENT 0.0 .INDENT 3.5 Manually modifying files under \fB/etc/letsencrypt/renewal/\fP can damage them if done improperly and we do not recommend doing so. .UNINDENT .UNINDENT .SS Automated Renewals .sp Most Certbot installations come with automatic renewals preconfigured. This is done by means of a scheduled task which runs \fBcertbot renew\fP periodically. .sp If you are unsure whether you need to configure automated renewal: .INDENT 0.0 .IP 1. 3 Review the instructions for your system and installation method at \fI\%https://certbot.eff.org/instructions\fP\&. They will describe how to set up a scheduled task, if necessary. If no step is listed, your system comes with automated renewal pre\-installed, and you should not need to take any additional actions. .IP 2. 3 On Linux and BSD, you can check to see if your installation method has pre\-installed a timer for you. To do so, look for the \fBcertbot renew\fP command in either your system\(aqs crontab (typically \fB/etc/crontab\fP or \fB/etc/cron.*/*\fP) or systemd timers (\fBsystemctl list\-timers\fP). .IP 3. 3 If you\(aqre still not sure, you can configure automated renewal manually by following the steps in the next section. Certbot has been carefully engineered to handle the case where both manual automated renewal and pre\-installed automated renewal are set up. .UNINDENT .SS Setting up automated renewal .sp If you think you may need to set up automated renewal, follow these instructions to set up a scheduled task to automatically renew your certificates in the background. If you are unsure whether your system has a pre\-installed scheduled task for Certbot, it is safe to follow these instructions to create one. .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 If you\(aqre using Windows, these instructions are not neccessary as Certbot on Windows comes with a scheduled task for automated renewal pre\-installed. .sp If you are using macOS and installed Certbot using Homebrew, follow the instructions at \fI\%https://certbot.eff.org/instructions\fP to set up automated renewal. The instructions below are not applicable on macOS. .UNINDENT .UNINDENT .sp Run the following line, which will add a cron job to \fB/etc/crontab\fP: .INDENT 0.0 .INDENT 3.5 .sp .EX SLEEPTIME=$(awk \(aqBEGIN{srand(); print int(rand()*(3600+1))}\(aq); echo \(dq0 0,12 * * * root sleep $SLEEPTIME && certbot renew \-q\(dq | sudo tee \-a /etc/crontab > /dev/null .EE .UNINDENT .UNINDENT .sp If you needed to stop your webserver to run Certbot, you\(aqll want to add \fBpre\fP and \fBpost\fP hooks to stop and start your webserver automatically. For example, if your webserver is HAProxy, run the following commands to create the hook files in the appropriate directory: .INDENT 0.0 .INDENT 3.5 .sp .EX sudo sh \-c \(aqprintf \(dq#!/bin/sh\enservice haproxy stop\en\(dq > /etc/letsencrypt/renewal\-hooks/pre/haproxy.sh\(aq sudo sh \-c \(aqprintf \(dq#!/bin/sh\enservice haproxy start\en\(dq > /etc/letsencrypt/renewal\-hooks/post/haproxy.sh\(aq sudo chmod 755 /etc/letsencrypt/renewal\-hooks/pre/haproxy.sh sudo chmod 755 /etc/letsencrypt/renewal\-hooks/post/haproxy.sh .EE .UNINDENT .UNINDENT .sp Congratulations, Certbot will now automatically renew your certificates in the background. .sp If you are interested in learning more about how Certbot renews your certificates, see the \fI\%Renewing certificates\fP section above. .SS Where are my certificates? .sp All generated keys and issued certificates can be found in \fB/etc/letsencrypt/live/$domain\fP, where \fB$domain\fP is the certificate name (see the note below). Rather than copying, please point your (web) server configuration directly to those files (or create symlinks). During the \fI\%renewal\fP, \fB/etc/letsencrypt/live\fP is updated with the latest necessary files. .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 The certificate name \fB$domain\fP used in the path \fB/etc/letsencrypt/live/$domain\fP follows this convention: .INDENT 0.0 .IP \(bu 2 it is the name given to \fB\-\-cert\-name\fP, .IP \(bu 2 if \fB\-\-cert\-name\fP is not set by the user it is the first domain given to \fB\-\-domains\fP, .IP \(bu 2 if the first domain is a wildcard domain (eg. \fB*.example.com\fP) the certificate name will be \fBexample.com\fP, .IP \(bu 2 if a name collision would occur with a certificate already named \fBexample.com\fP, the new certificate name will be constructed using a numerical sequence as \fBexample.com\-001\fP\&. .UNINDENT .UNINDENT .UNINDENT .sp For historical reasons, the containing directories are created with permissions of \fB0700\fP meaning that certificates are accessible only to servers that run as the root user. \fBIf you will never downgrade to an older version of Certbot\fP, then you can safely fix this using \fBchmod 0755 /etc/letsencrypt/{live,archive}\fP\&. .sp For servers that drop root privileges before attempting to read the private key file, you will also need to use \fBchgrp\fP and \fBchmod 0640\fP to allow the server to read \fB/etc/letsencrypt/live/$domain/privkey.pem\fP\&. .sp The following files are available: .INDENT 0.0 .TP .B \fBprivkey.pem\fP Private key for the certificate. .sp \fBWARNING:\fP .INDENT 7.0 .INDENT 3.5 This \fBmust be kept secret at all times\fP! Never share it with anyone, including Certbot developers. You cannot put it into a safe, however \- your server still needs to access this file in order for SSL/TLS to work. .UNINDENT .UNINDENT .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 As of Certbot version 0.29.0, private keys for new certificate default to \fB0600\fP\&. Any changes to the group mode or group owner (gid) of this file will be preserved on renewals. .UNINDENT .UNINDENT .sp This is what Apache needs for \fI\%SSLCertificateKeyFile\fP, and Nginx for \fI\%ssl_certificate_key\fP\&. .TP .B \fBfullchain.pem\fP All certificates, \fBincluding\fP server certificate (aka leaf certificate or end\-entity certificate). The server certificate is the first one in this file, followed by any intermediates. .sp This is what Apache >= 2.4.8 needs for \fI\%SSLCertificateFile\fP, and what Nginx needs for \fI\%ssl_certificate\fP\&. .TP .B \fBcert.pem\fP and \fBchain.pem\fP (less common) \fBcert.pem\fP contains the server certificate by itself, and \fBchain.pem\fP contains the additional intermediate certificate or certificates that web browsers will need in order to validate the server certificate. If you provide one of these files to your web server, you \fBmust\fP provide both of them, or some browsers will show \(dqThis Connection is Untrusted\(dq errors for your site, \fI\%some of the time\fP\&. .sp Apache < 2.4.8 needs these for \fI\%SSLCertificateFile\fP\&. and \fI\%SSLCertificateChainFile\fP, respectively. .sp If you\(aqre using OCSP stapling with Nginx >= 1.3.7, \fBchain.pem\fP should be provided as the \fI\%ssl_trusted_certificate\fP to validate OCSP responses. .UNINDENT .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 All files are PEM\-encoded. If you need other format, such as DER or PFX, then you could convert using \fBopenssl\fP\&. You can automate that with \fB\-\-deploy\-hook\fP if you\(aqre using automatic \fI\%renewal\fP\&. .UNINDENT .UNINDENT .SS Pre and Post Validation Hooks .sp Certbot allows for the specification of pre and post validation hooks when run in manual mode. The flags to specify these scripts are \fB\-\-manual\-auth\-hook\fP and \fB\-\-manual\-cleanup\-hook\fP respectively and can be used as follows: .INDENT 0.0 .INDENT 3.5 .sp .EX certbot certonly \-\-manual \-\-manual\-auth\-hook /path/to/http/authenticator.sh \-\-manual\-cleanup\-hook /path/to/http/cleanup.sh \-d secure.example.com .EE .UNINDENT .UNINDENT .sp This will run the \fBauthenticator.sh\fP script, attempt the validation, and then run the \fBcleanup.sh\fP script. Additionally certbot will pass relevant environment variables to these scripts: .INDENT 0.0 .IP \(bu 2 \fBCERTBOT_DOMAIN\fP: The domain being authenticated .IP \(bu 2 \fBCERTBOT_VALIDATION\fP: The validation string .IP \(bu 2 \fBCERTBOT_TOKEN\fP: Resource name part of the HTTP\-01 challenge (HTTP\-01 only) .IP \(bu 2 \fBCERTBOT_REMAINING_CHALLENGES\fP: Number of challenges remaining after the current challenge .IP \(bu 2 \fBCERTBOT_ALL_DOMAINS\fP: A comma\-separated list of all domains challenged for the current certificate .UNINDENT .sp Additionally for cleanup: .INDENT 0.0 .IP \(bu 2 \fBCERTBOT_AUTH_OUTPUT\fP: Whatever the auth script wrote to stdout .UNINDENT .sp Example usage for HTTP\-01: .INDENT 0.0 .INDENT 3.5 .sp .EX certbot certonly \-\-manual \-\-preferred\-challenges=http \-\-manual\-auth\-hook /path/to/http/authenticator.sh \-\-manual\-cleanup\-hook /path/to/http/cleanup.sh \-d secure.example.com .EE .UNINDENT .UNINDENT .sp /path/to/http/authenticator.sh .INDENT 0.0 .INDENT 3.5 .sp .EX #!/bin/bash echo $CERTBOT_VALIDATION > /var/www/htdocs/.well\-known/acme\-challenge/$CERTBOT_TOKEN .EE .UNINDENT .UNINDENT .sp /path/to/http/cleanup.sh .INDENT 0.0 .INDENT 3.5 .sp .EX #!/bin/bash rm \-f /var/www/htdocs/.well\-known/acme\-challenge/$CERTBOT_TOKEN .EE .UNINDENT .UNINDENT .sp Example usage for DNS\-01 (Cloudflare API v4) (for example purposes only, do not use as\-is) .INDENT 0.0 .INDENT 3.5 .sp .EX certbot certonly \-\-manual \-\-preferred\-challenges=dns \-\-manual\-auth\-hook /path/to/dns/authenticator.sh \-\-manual\-cleanup\-hook /path/to/dns/cleanup.sh \-d secure.example.com .EE .UNINDENT .UNINDENT .sp /path/to/dns/authenticator.sh .INDENT 0.0 .INDENT 3.5 .sp .EX #!/bin/bash # Get your API key from https://www.cloudflare.com/a/account/my\-account API_KEY=\(dqyour\-api\-key\(dq EMAIL=\(dqyour.email@example.com\(dq # Strip only the top domain to get the zone id DOMAIN=$(expr match \(dq$CERTBOT_DOMAIN\(dq \(aq.*\e.\e(.*\e..*\e)\(aq) # Get the Cloudflare zone id ZONE_EXTRA_PARAMS=\(dqstatus=active&page=1&per_page=20&order=status&direction=desc&match=all\(dq ZONE_ID=$(curl \-s \-X GET \(dqhttps://api.cloudflare.com/client/v4/zones?name=$DOMAIN&$ZONE_EXTRA_PARAMS\(dq \e \-H \(dqX\-Auth\-Email: $EMAIL\(dq \e \-H \(dqX\-Auth\-Key: $API_KEY\(dq \e \-H \(dqContent\-Type: application/json\(dq | python \-c \(dqimport sys,json;print(json.load(sys.stdin)[\(aqresult\(aq][0][\(aqid\(aq])\(dq) # Create TXT record CREATE_DOMAIN=\(dq_acme\-challenge.$CERTBOT_DOMAIN\(dq RECORD_ID=$(curl \-s \-X POST \(dqhttps://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records\(dq \e \-H \(dqX\-Auth\-Email: $EMAIL\(dq \e \-H \(dqX\-Auth\-Key: $API_KEY\(dq \e \-H \(dqContent\-Type: application/json\(dq \e \-\-data \(aq{\(dqtype\(dq:\(dqTXT\(dq,\(dqname\(dq:\(dq\(aq\(dq$CREATE_DOMAIN\(dq\(aq\(dq,\(dqcontent\(dq:\(dq\(aq\(dq$CERTBOT_VALIDATION\(dq\(aq\(dq,\(dqttl\(dq:120}\(aq \e | python \-c \(dqimport sys,json;print(json.load(sys.stdin)[\(aqresult\(aq][\(aqid\(aq])\(dq) # Save info for cleanup if [ ! \-d /tmp/CERTBOT_$CERTBOT_DOMAIN ];then mkdir \-m 0700 /tmp/CERTBOT_$CERTBOT_DOMAIN fi echo $ZONE_ID > /tmp/CERTBOT_$CERTBOT_DOMAIN/ZONE_ID echo $RECORD_ID > /tmp/CERTBOT_$CERTBOT_DOMAIN/RECORD_ID # Sleep to make sure the change has time to propagate over to DNS sleep 25 .EE .UNINDENT .UNINDENT .sp /path/to/dns/cleanup.sh .INDENT 0.0 .INDENT 3.5 .sp .EX #!/bin/bash # Get your API key from https://www.cloudflare.com/a/account/my\-account API_KEY=\(dqyour\-api\-key\(dq EMAIL=\(dqyour.email@example.com\(dq if [ \-f /tmp/CERTBOT_$CERTBOT_DOMAIN/ZONE_ID ]; then ZONE_ID=$(cat /tmp/CERTBOT_$CERTBOT_DOMAIN/ZONE_ID) rm \-f /tmp/CERTBOT_$CERTBOT_DOMAIN/ZONE_ID fi if [ \-f /tmp/CERTBOT_$CERTBOT_DOMAIN/RECORD_ID ]; then RECORD_ID=$(cat /tmp/CERTBOT_$CERTBOT_DOMAIN/RECORD_ID) rm \-f /tmp/CERTBOT_$CERTBOT_DOMAIN/RECORD_ID fi # Remove the challenge TXT record from the zone if [ \-n \(dq${ZONE_ID}\(dq ]; then if [ \-n \(dq${RECORD_ID}\(dq ]; then curl \-s \-X DELETE \(dqhttps://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records/$RECORD_ID\(dq \e \-H \(dqX\-Auth\-Email: $EMAIL\(dq \e \-H \(dqX\-Auth\-Key: $API_KEY\(dq \e \-H \(dqContent\-Type: application/json\(dq fi fi .EE .UNINDENT .UNINDENT .SS Changing the ACME Server .sp By default, Certbot uses Let\(aqs Encrypt\(aqs production server at \fI\%https://acme\-v02.api.letsencrypt.org/directory\fP\&. You can tell Certbot to use a different CA by providing \fB\-\-server\fP on the command line or in a \fI\%configuration file\fP with the URL of the server\(aqs ACME directory. For example, if you would like to use Let\(aqs Encrypt\(aqs staging server, you would add \fB\-\-server https://acme\-staging\-v02.api.letsencrypt.org/directory\fP to the command line. .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 \fB\-\-dry\-run\fP uses the Let\(aqs Encrypt staging server, unless \fB\-\-server\fP is specified on the CLI or in the \fI\%cli.ini configuration file\fP\&. Take caution when using \fB\-\-dry\-run\fP with a custom server, as it may cause real certificates to be issued and discarded. .UNINDENT .UNINDENT .sp If Certbot does not trust the SSL certificate used by the ACME server, you can use the \fI\%REQUESTS_CA_BUNDLE\fP environment variable to override the root certificates trusted by Certbot. Certbot uses the \fBrequests\fP library, which does not use the operating system trusted root store. Make sure that \fBREQUESTS_CA_BUNDLE\fP is set globally in the environment and not only on the CLI, or scheduled renewal will not succeed. .SS Lock Files .sp When processing a validation Certbot writes a number of lock files on your system to prevent multiple instances from overwriting each other\(aqs changes. This means that by default two instances of Certbot will not be able to run in parallel. .sp Since the directories used by Certbot are configurable, Certbot will write a lock file for all of the directories it uses. This include Certbot\(aqs \fB\-\-work\-dir\fP, \fB\-\-logs\-dir\fP, and \fB\-\-config\-dir\fP\&. By default these are \fB/var/lib/letsencrypt\fP, \fB/var/log/letsencrypt\fP, and \fB/etc/letsencrypt\fP respectively. Additionally if you are using Certbot with Apache or nginx it will lock the configuration folder for that program, which are typically also in the \fB/etc\fP directory. .sp Note that these lock files will only prevent other instances of Certbot from using those directories, not other processes. If you\(aqd like to run multiple instances of Certbot simultaneously you should specify different directories as the \fB\-\-work\-dir\fP, \fB\-\-logs\-dir\fP, and \fB\-\-config\-dir\fP for each instance of Certbot that you would like to run. .SS Configuration file .sp Certbot accepts a global configuration file that applies its options to all invocations of Certbot. Certificate specific configuration choices should be set in the \fB\&.conf\fP files that can be found in \fB/etc/letsencrypt/renewal\fP\&. .sp By default no cli.ini file is created (though it may exist already if you installed Certbot via a package manager, for instance). After creating one it is possible to specify the location of this configuration file with \fBcertbot \-\-config cli.ini\fP (or shorter \fB\-c cli.ini\fP). An example configuration file is shown below: .INDENT 0.0 .INDENT 3.5 .sp .EX # This is an example of the kind of things you can do in a configuration file. # All flags used by the client can be configured here. Run Certbot with # \(dq\-\-help\(dq to learn more about the available options. # # Note that these options apply automatically to all use of Certbot for # obtaining or renewing certificates, so options specific to a single # certificate on a system with several certificates should not be placed # here. # Use ECC for the private key key\-type = ecdsa elliptic\-curve = secp384r1 # Use a 4096 bit RSA key instead of 2048 rsa\-key\-size = 4096 # Uncomment and update to register with the specified e\-mail address # email = foo@example.com # Uncomment to use the standalone authenticator on port 443 # authenticator = standalone # Uncomment to use the webroot authenticator. Replace webroot\-path with the # path to the public_html / webroot folder being served by your web server. # authenticator = webroot # webroot\-path = /usr/share/nginx/html # Uncomment to automatically agree to the terms of service of the ACME server # agree\-tos = true # An example of using an alternate ACME server that uses EAB credentials # server = https://acme.sectigo.com/v2/InCommonRSAOV # eab\-kid = somestringofstuffwithoutquotes # eab\-hmac\-key = yaddayaddahexhexnotquoted .EE .UNINDENT .UNINDENT .sp By default, the following locations are searched: .INDENT 0.0 .IP \(bu 2 \fB/etc/letsencrypt/cli.ini\fP .IP \(bu 2 \fB$XDG_CONFIG_HOME/letsencrypt/cli.ini\fP (or \fB~/.config/letsencrypt/cli.ini\fP if \fB$XDG_CONFIG_HOME\fP is not set). .UNINDENT .sp Since this configuration file applies to all invocations of certbot it is incorrect to list domains in it. Listing domains in cli.ini may prevent renewal from working. Additionally due to how arguments in cli.ini are parsed, options which wish to not be set should not be listed. Options set to false will instead be read as being set to true by older versions of Certbot, since they have been listed in the config file. .SS Log Rotation .sp By default certbot stores status logs in \fB/var/log/letsencrypt\fP\&. By default certbot will begin rotating logs once there are 1000 logs in the log directory. Meaning that once 1000 files are in \fB/var/log/letsencrypt\fP Certbot will delete the oldest one to make room for new logs. The number of subsequent logs can be changed by passing the desired number to the command line flag \fB\-\-max\-log\-backups\fP\&. Setting this flag to 0 disables log rotation entirely, causing certbot to always append to the same log file. .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 Some distributions, including Debian and Ubuntu, disable certbot\(aqs internal log rotation in favor of a more traditional logrotate script. If you are using a distribution\(aqs packages and want to alter the log rotation, check \fB/etc/logrotate.d/\fP for a certbot rotation script. .UNINDENT .UNINDENT .SS Certbot command\-line options .sp Certbot supports a lot of command line options. Here\(aqs the full list, from \fBcertbot \-\-help all\fP: .INDENT 0.0 .INDENT 3.5 .sp .EX usage: certbot [SUBCOMMAND] [options] [\-d DOMAIN] [\-d DOMAIN] ... Certbot can obtain and install HTTPS/TLS/SSL certificates. By default, it will attempt to use a webserver both for obtaining and installing the certificate. The most common SUBCOMMANDS and flags are: obtain, install, and renew certificates: (default) run Obtain & install a certificate in your current webserver certonly Obtain or renew a certificate, but do not install it renew Renew all previously obtained certificates that are near expiry enhance Add security enhancements to your existing configuration \-d DOMAINS Comma\-separated list of domains to obtain a certificate for \-\-apache Use the Apache plugin for authentication & installation \-\-standalone Run a standalone webserver for authentication \-\-nginx Use the Nginx plugin for authentication & installation \-\-webroot Place files in a server\(aqs webroot folder for authentication \-\-manual Obtain certificates interactively, or using shell script hooks \-n Run non\-interactively \-\-test\-cert Obtain a test certificate from a staging server \-\-dry\-run Test \(dqrenew\(dq or \(dqcertonly\(dq without saving any certificates to disk manage certificates: certificates Display information about certificates you have from Certbot revoke Revoke a certificate (supply \-\-cert\-name or \-\-cert\-path) delete Delete a certificate (supply \-\-cert\-name) reconfigure Update a certificate\(aqs configuration (supply \-\-cert\-name) manage your account: register Create an ACME account unregister Deactivate an ACME account update_account Update an ACME account show_account Display account details \-\-agree\-tos Agree to the ACME server\(aqs Subscriber Agreement \-m EMAIL Email address for important account notifications options: \-h, \-\-help show this help message and exit \-c CONFIG_FILE, \-\-config CONFIG_FILE path to config file (default: /etc/letsencrypt/cli.ini and ~/.config/letsencrypt/cli.ini) \-v, \-\-verbose This flag can be used multiple times to incrementally increase the verbosity of output, e.g. \-vvv. (default: 0) \-\-max\-log\-backups MAX_LOG_BACKUPS Specifies the maximum number of backup logs that should be kept by Certbot\(aqs built in log rotation. Setting this flag to 0 disables log rotation entirely, causing Certbot to always append to the same log file. (default: 1000) \-n, \-\-non\-interactive, \-\-noninteractive Run without ever asking for user input. This may require additional command line flags; the client will try to explain which ones are required if it finds one missing (default: False) \-\-force\-interactive Force Certbot to be interactive even if it detects it\(aqs not being run in a terminal. This flag cannot be used with the renew subcommand. (default: False) \-d DOMAIN, \-\-domains DOMAIN, \-\-domain DOMAIN Domain names to include. For multiple domains you can use multiple \-d flags or enter a comma separated list of domains as a parameter. All domains will be included as Subject Alternative Names on the certificate. The first domain will be used as the certificate name, unless otherwise specified or if you already have a certificate with the same name. In the case of a name conflict, a number like \-0001 will be appended to the certificate name. (default: Ask) \-\-eab\-kid EAB_KID Key Identifier for External Account Binding (default: None) \-\-eab\-hmac\-key EAB_HMAC_KEY HMAC key for External Account Binding (default: None) \-\-cert\-name CERTNAME Certificate name to apply. This name is used by Certbot for housekeeping and in file paths; it doesn\(aqt affect the content of the certificate itself. Certificate name cannot contain filepath separators (i.e. \(aq/\(aq or \(aq\e\(aq, depending on the platform). To see certificate names, run \(aqcertbot certificates\(aq. When creating a new certificate, specifies the new certificate\(aqs name. (default: the first provided domain or the name of an existing certificate on your system for the same domains) \-\-dry\-run Perform a test run against the Let\(aqs Encrypt staging server, obtaining test (invalid) certificates but not saving them to disk. This can only be used with the \(aqcertonly\(aq and \(aqrenew\(aq subcommands. It may trigger webserver reloads to temporarily modify & roll back configuration files. \-\-pre\-hook and \-\-post\-hook commands run by default. \-\-deploy\-hook commands do not run, unless enabled by \-\-run\-deploy\-hooks. The test server may be overridden with \-\-server. (default: False) \-\-debug\-challenges After setting up challenges, wait for user input before submitting to CA. When used in combination with the \(ga\-v\(ga option, the challenge URLs or FQDNs and their expected return values are shown. (default: False) \-\-preferred\-chain PREFERRED_CHAIN Set the preferred certificate chain. If the CA offers multiple certificate chains, prefer the chain whose topmost certificate was issued from this Subject Common Name. If no match, the default offered chain will be used. (default: None) \-\-preferred\-challenges PREF_CHALLS A sorted, comma delimited list of the preferred challenge to use during authorization with the most preferred challenge listed first (Eg, \(dqdns\(dq or \(dqhttp,dns\(dq). Not all plugins support all challenges. See https://certbot.eff.org/docs/using.html#plugins for details. ACME Challenges are versioned, but if you pick \(dqhttp\(dq rather than \(dqhttp\-01\(dq, Certbot will select the latest version automatically. (default: []) \-\-issuance\-timeout ISSUANCE_TIMEOUT This option specifies how long (in seconds) Certbot will wait for the server to issue a certificate. (default: 90) \-\-user\-agent USER_AGENT Set a custom user agent string for the client. User agent strings allow the CA to collect high level statistics about success rates by OS, plugin and use case, and to know when to deprecate support for past Python versions and flags. If you wish to hide this information from the Let\(aqs Encrypt server, set this to \(dq\(dq. (default: CertbotACMEClient/2.8.0 (certbot; OS_NAME OS_VERSION) Authenticator/XXX Installer/YYY (SUBCOMMAND; flags: FLAGS) Py/major.minor.patchlevel). The flags encoded in the user agent are: \-\-duplicate, \-\-force\-renew, \-\-allow\-subset\-of\-names, \-n, and whether any hooks are set. \-\-user\-agent\-comment USER_AGENT_COMMENT Add a comment to the default user agent string. May be used when repackaging Certbot or calling it from another tool to allow additional statistical data to be collected. Ignored if \-\-user\-agent is set. (Example: Foo\-Wrapper/1.0) (default: None) automation: Flags for automating execution & other tweaks \-\-keep\-until\-expiring, \-\-keep, \-\-reinstall If the requested certificate matches an existing certificate, always keep the existing one until it is due for renewal (for the \(aqrun\(aq subcommand this means reinstall the existing certificate). (default: Ask) \-\-expand If an existing certificate is a strict subset of the requested names, always expand and replace it with the additional names. (default: Ask) \-\-version show program\(aqs version number and exit \-\-force\-renewal, \-\-renew\-by\-default If a certificate already exists for the requested domains, renew it now, regardless of whether it is near expiry. (Often \-\-keep\-until\-expiring is more appropriate). Also implies \-\-expand. (default: False) \-\-renew\-with\-new\-domains If a certificate already exists for the requested certificate name but does not match the requested domains, renew it now, regardless of whether it is near expiry. (default: False) \-\-reuse\-key When renewing, use the same private key as the existing certificate. (default: False) \-\-no\-reuse\-key When renewing, do not use the same private key as the existing certificate. Not reusing private keys is the default behavior of Certbot. This option may be used to unset \-\-reuse\-key on an existing certificate. (default: False) \-\-new\-key When renewing or replacing a certificate, generate a new private key, even if \-\-reuse\-key is set on the existing certificate. Combining \-\-new\-key and \-\-reuse\- key will result in the private key being replaced and then reused in future renewals. (default: False) \-\-allow\-subset\-of\-names When performing domain validation, do not consider it a failure if authorizations can not be obtained for a strict subset of the requested domains. This may be useful for allowing renewals for multiple domains to succeed even if some domains no longer point at this system. This option cannot be used with \-\-csr. (default: False) \-\-agree\-tos Agree to the ACME Subscriber Agreement (default: Ask) \-\-duplicate Allow making a certificate lineage that duplicates an existing one (both can be renewed in parallel) (default: False) \-q, \-\-quiet Silence all output except errors. Useful for automation via cron. Implies \-\-non\-interactive. (default: False) security: Security parameters & server settings \-\-rsa\-key\-size N Size of the RSA key. (default: 2048) \-\-key\-type {rsa,ecdsa} Type of generated private key. Only *ONE* per invocation can be provided at this time. (default: ecdsa) \-\-elliptic\-curve N The SECG elliptic curve name to use. Please see RFC 8446 for supported values. (default: secp256r1) \-\-must\-staple Adds the OCSP Must\-Staple extension to the certificate. Autoconfigures OCSP Stapling for supported setups (Apache version >= 2.3.3 ). (default: False) \-\-redirect Automatically redirect all HTTP traffic to HTTPS for the newly authenticated vhost. (default: redirect enabled for install and run, disabled for enhance) \-\-no\-redirect Do not automatically redirect all HTTP traffic to HTTPS for the newly authenticated vhost. (default: redirect enabled for install and run, disabled for enhance) \-\-hsts Add the Strict\-Transport\-Security header to every HTTP response. Forcing browser to always use SSL for the domain. Defends against SSL Stripping. (default: None) \-\-uir Add the \(dqContent\-Security\-Policy: upgrade\-insecure\- requests\(dq header to every HTTP response. Forcing the browser to use https:// for every http:// resource. (default: None) \-\-staple\-ocsp Enables OCSP Stapling. A valid OCSP response is stapled to the certificate that the server offers during TLS. (default: None) \-\-strict\-permissions Require that all configuration files are owned by the current user; only needed if your config is somewhere unsafe like /tmp/ (default: False) \-\-auto\-hsts Gradually increasing max\-age value for HTTP Strict Transport Security security header (default: False) testing: The following flags are meant for testing and integration purposes only. \-\-run\-deploy\-hooks When performing a test run using \(ga\-\-dry\-run\(ga or \(gareconfigure\(ga, run any applicable deploy hooks. This includes hooks set on the command line, saved in the certificate\(aqs renewal configuration file, or present in the renewal\-hooks directory. To exclude directory hooks, use \-\-no\-directory\-hooks. The hook(s) will only be run if the dry run succeeds, and will use the current active certificate, not the temporary test certificate acquired during the dry run. This flag is recommended when modifying the deploy hook using \(gareconfigure\(ga. (default: False) \-\-test\-cert, \-\-staging Use the Let\(aqs Encrypt staging server to obtain or revoke test (invalid) certificates; equivalent to \-\-server https://acme\- staging\-v02.api.letsencrypt.org/directory (default: False) \-\-debug Show tracebacks in case of errors (default: False) \-\-no\-verify\-ssl Disable verification of the ACME server\(aqs certificate. The root certificates trusted by Certbot can be overriden by setting the REQUESTS_CA_BUNDLE environment variable. (default: False) \-\-http\-01\-port HTTP01_PORT Port used in the http\-01 challenge. This only affects the port Certbot listens on. A conforming ACME server will still attempt to connect on port 80. (default: 80) \-\-http\-01\-address HTTP01_ADDRESS The address the server listens to during http\-01 challenge. (default: ) \-\-https\-port HTTPS_PORT Port used to serve HTTPS. This affects which port Nginx will listen on after a LE certificate is installed. (default: 443) \-\-break\-my\-certs Be willing to replace or renew valid certificates with invalid (testing/staging) certificates (default: False) paths: Flags for changing execution paths & servers \-\-cert\-path CERT_PATH Path to where certificate is saved (with certonly \-\-csr), installed from, or revoked (default: None) \-\-key\-path KEY_PATH Path to private key for certificate installation or revocation (if account key is missing) (default: None) \-\-fullchain\-path FULLCHAIN_PATH Accompanying path to a full certificate chain (certificate plus chain). (default: None) \-\-chain\-path CHAIN_PATH Accompanying path to a certificate chain. (default: None) \-\-config\-dir CONFIG_DIR Configuration directory. (default: /etc/letsencrypt) \-\-work\-dir WORK_DIR Working directory. (default: /var/lib/letsencrypt) \-\-logs\-dir LOGS_DIR Logs directory. (default: /var/log/letsencrypt) \-\-server SERVER ACME Directory Resource URI. (default: https://acme\-v02.api.letsencrypt.org/directory) manage: Various subcommands and flags are available for managing your certificates: certificates List certificates managed by Certbot delete Clean up all files related to a certificate renew Renew all certificates (or one specified with \-\-cert\- name) revoke Revoke a certificate specified with \-\-cert\-path or \-\-cert\-name reconfigure Update renewal configuration for a certificate specified by \-\-cert\-name run: Options for obtaining & installing certificates certonly: Options for modifying how a certificate is obtained \-\-csr CSR Path to a Certificate Signing Request (CSR) in DER or PEM format. Currently \-\-csr only works with the \(aqcertonly\(aq subcommand. (default: None) renew: The \(aqrenew\(aq subcommand will attempt to renew any certificates previously obtained if they are close to expiry, and print a summary of the results. By default, \(aqrenew\(aq will reuse the plugins and options used to obtain or most recently renew each certificate. You can test whether future renewals will succeed with \(ga\-\-dry\-run\(ga. Individual certificates can be renewed with the \(ga\-\-cert\-name\(ga option. Hooks are available to run commands before and after renewal; see https://certbot.eff.org/docs/using.html#renewal for more information on these. \-\-pre\-hook PRE_HOOK Command to be run in a shell before obtaining any certificates. Unless \-\-disable\-hook\-validation is used, the command’s first word must be the absolute pathname of an executable or one found via the PATH environment variable. Intended primarily for renewal, where it can be used to temporarily shut down a webserver that might conflict with the standalone plugin. This will only be called if a certificate is actually to be obtained/renewed. When renewing several certificates that have identical pre\-hooks, only the first will be executed. (default: None) \-\-post\-hook POST_HOOK Command to be run in a shell after attempting to obtain/renew certificates. Unless \-\-disable\-hook\- validation is used, the command’s first word must be the absolute pathname of an executable or one found via the PATH environment variable. Can be used to deploy renewed certificates, or to restart any servers that were stopped by \-\-pre\-hook. This is only run if an attempt was made to obtain/renew a certificate. If multiple renewed certificates have identical post\- hooks, only one will be run. (default: None) \-\-deploy\-hook DEPLOY_HOOK Command to be run in a shell once for each successfully issued certificate. Unless \-\-disable\- hook\-validation is used, the command’s first word must be the absolute pathname of an executable or one found via the PATH environment variable. For this command, the shell variable $RENEWED_LINEAGE will point to the config live subdirectory (for example, \(dq/etc/letsencrypt/live/example.com\(dq) containing the new certificates and keys; the shell variable $RENEWED_DOMAINS will contain a space\-delimited list of renewed certificate domains (for example, \(dqexample.com www.example.com\(dq) (default: None) \-\-disable\-hook\-validation Ordinarily the commands specified for \-\-pre\- hook/\-\-post\-hook/\-\-deploy\-hook will be checked for validity, to see if the programs being run are in the $PATH, so that mistakes can be caught early, even when the hooks aren\(aqt being run just yet. The validation is rather simplistic and fails if you use more advanced shell constructs, so you can use this switch to disable it. (default: False) \-\-no\-directory\-hooks Disable running executables found in Certbot\(aqs hook directories during renewal. (default: False) \-\-disable\-renew\-updates Disable automatic updates to your server configuration that would otherwise be done by the selected installer plugin, and triggered when the user executes \(dqcertbot renew\(dq, regardless of if the certificate is renewed. This setting does not apply to important TLS configuration updates. (default: False) \-\-no\-autorenew Disable auto renewal of certificates. (default: False) certificates: List certificates managed by Certbot delete: Options for deleting a certificate revoke: Options for revocation of certificates \-\-reason {unspecified,keycompromise,affiliationchanged,superseded,cessationofoperation} Specify reason for revoking certificate. (default: unspecified) \-\-delete\-after\-revoke Delete certificates after revoking them, along with all previous and later versions of those certificates. (default: None) \-\-no\-delete\-after\-revoke Do not delete certificates after revoking them. This option should be used with caution because the \(aqrenew\(aq subcommand will attempt to renew undeleted revoked certificates. (default: None) register: Options for account registration \-\-register\-unsafely\-without\-email Specifying this flag enables registering an account with no email address. This is strongly discouraged, because you will be unable to receive notice about impending expiration or revocation of your certificates or problems with your Certbot installation that will lead to failure to renew. (default: False) \-m EMAIL, \-\-email EMAIL Email used for registration and recovery contact. Use comma to register multiple emails, ex: u1@example.com,u2@example.com. (default: Ask). \-\-eff\-email Share your e\-mail address with EFF (default: None) \-\-no\-eff\-email Don\(aqt share your e\-mail address with EFF (default: None) update_account: Options for account modification unregister: Options for account deactivation. \-\-account ACCOUNT_ID Account ID to use (default: None) install: Options for modifying how a certificate is deployed rollback: Options for rolling back server configuration changes \-\-checkpoints N Revert configuration N number of checkpoints. (default: 1) plugins: Options for the \(dqplugins\(dq subcommand \-\-init Initialize plugins. (default: False) \-\-prepare Initialize and prepare plugins. (default: False) \-\-authenticators Limit to authenticator plugins only. (default: None) \-\-installers Limit to installer plugins only. (default: None) enhance: Helps to harden the TLS configuration by adding security enhancements to already existing configuration. show_account: Options useful for the \(dqshow_account\(dq subcommand: reconfigure: Common options that may be updated with the \(dqreconfigure\(dq subcommand: plugins: Plugin Selection: Certbot client supports an extensible plugins architecture. See \(aqcertbot plugins\(aq for a list of all installed plugins and their names. You can force a particular plugin by setting options provided below. Running \-\-help will list flags specific to that plugin. \-\-configurator CONFIGURATOR Name of the plugin that is both an authenticator and an installer. Should not be used together with \-\-authenticator or \-\-installer. (default: Ask) \-a AUTHENTICATOR, \-\-authenticator AUTHENTICATOR Authenticator plugin name. (default: None) \-i INSTALLER, \-\-installer INSTALLER Installer plugin name (also used to find domains). (default: None) \-\-apache Obtain and install certificates using Apache (default: False) \-\-nginx Obtain and install certificates using Nginx (default: False) \-\-standalone Obtain certificates using a \(dqstandalone\(dq webserver. (default: False) \-\-manual Provide laborious manual instructions for obtaining a certificate (default: False) \-\-webroot Obtain certificates by placing files in a webroot directory. (default: False) \-\-dns\-cloudflare Obtain certificates using a DNS TXT record (if you are using Cloudflare for DNS). (default: False) \-\-dns\-digitalocean Obtain certificates using a DNS TXT record (if you are using DigitalOcean for DNS). (default: False) \-\-dns\-dnsimple Obtain certificates using a DNS TXT record (if you are using DNSimple for DNS). (default: False) \-\-dns\-dnsmadeeasy Obtain certificates using a DNS TXT record (if you are using DNS Made Easy for DNS). (default: False) \-\-dns\-gehirn Obtain certificates using a DNS TXT record (if you are using Gehirn Infrastructure Service for DNS). (default: False) \-\-dns\-google Obtain certificates using a DNS TXT record (if you are using Google Cloud DNS). (default: False) \-\-dns\-linode Obtain certificates using a DNS TXT record (if you are using Linode for DNS). (default: False) \-\-dns\-luadns Obtain certificates using a DNS TXT record (if you are using LuaDNS for DNS). (default: False) \-\-dns\-nsone Obtain certificates using a DNS TXT record (if you are using NS1 for DNS). (default: False) \-\-dns\-ovh Obtain certificates using a DNS TXT record (if you are using OVH for DNS). (default: False) \-\-dns\-rfc2136 Obtain certificates using a DNS TXT record (if you are using BIND for DNS). (default: False) \-\-dns\-route53 Obtain certificates using a DNS TXT record (if you are using Route53 for DNS). (default: False) \-\-dns\-sakuracloud Obtain certificates using a DNS TXT record (if you are using Sakura Cloud for DNS). (default: False) apache: Apache Web Server plugin (Please note that the default values of the Apache plugin options change depending on the operating system Certbot is run on.) \-\-apache\-enmod APACHE_ENMOD Path to the Apache \(aqa2enmod\(aq binary (default: None) \-\-apache\-dismod APACHE_DISMOD Path to the Apache \(aqa2dismod\(aq binary (default: None) \-\-apache\-le\-vhost\-ext APACHE_LE_VHOST_EXT SSL vhost configuration extension (default: \-le\- ssl.conf) \-\-apache\-server\-root APACHE_SERVER_ROOT Apache server root directory (default: /etc/apache2) \-\-apache\-vhost\-root APACHE_VHOST_ROOT Apache server VirtualHost configuration root (default: None) \-\-apache\-logs\-root APACHE_LOGS_ROOT Apache server logs directory (default: /var/log/apache2) \-\-apache\-challenge\-location APACHE_CHALLENGE_LOCATION Directory path for challenge configuration (default: /etc/apache2) \-\-apache\-handle\-modules APACHE_HANDLE_MODULES Let installer handle enabling required modules for you (Only Ubuntu/Debian currently) (default: False) \-\-apache\-handle\-sites APACHE_HANDLE_SITES Let installer handle enabling sites for you (Only Ubuntu/Debian currently) (default: False) \-\-apache\-ctl APACHE_CTL Full path to Apache control script (default: apache2ctl) \-\-apache\-bin APACHE_BIN Full path to apache2/httpd binary (default: None) dns\-cloudflare: Obtain certificates using a DNS TXT record (if you are using Cloudflare for DNS). \-\-dns\-cloudflare\-propagation\-seconds DNS_CLOUDFLARE_PROPAGATION_SECONDS The number of seconds to wait for DNS to propagate before asking the ACME server to verify the DNS record. (default: 10) \-\-dns\-cloudflare\-credentials DNS_CLOUDFLARE_CREDENTIALS Cloudflare credentials INI file. (default: None) dns\-digitalocean: Obtain certificates using a DNS TXT record (if you are using DigitalOcean for DNS). \-\-dns\-digitalocean\-propagation\-seconds DNS_DIGITALOCEAN_PROPAGATION_SECONDS The number of seconds to wait for DNS to propagate before asking the ACME server to verify the DNS record. (default: 10) \-\-dns\-digitalocean\-credentials DNS_DIGITALOCEAN_CREDENTIALS DigitalOcean credentials INI file. (default: None) dns\-dnsimple: Obtain certificates using a DNS TXT record (if you are using DNSimple for DNS). \-\-dns\-dnsimple\-propagation\-seconds DNS_DNSIMPLE_PROPAGATION_SECONDS The number of seconds to wait for DNS to propagate before asking the ACME server to verify the DNS record. (default: 30) \-\-dns\-dnsimple\-credentials DNS_DNSIMPLE_CREDENTIALS DNSimple credentials INI file. (default: None) dns\-dnsmadeeasy: Obtain certificates using a DNS TXT record (if you are using DNS Made Easy for DNS). \-\-dns\-dnsmadeeasy\-propagation\-seconds DNS_DNSMADEEASY_PROPAGATION_SECONDS The number of seconds to wait for DNS to propagate before asking the ACME server to verify the DNS record. (default: 60) \-\-dns\-dnsmadeeasy\-credentials DNS_DNSMADEEASY_CREDENTIALS DNS Made Easy credentials INI file. (default: None) dns\-gehirn: Obtain certificates using a DNS TXT record (if you are using Gehirn Infrastructure Service for DNS). \-\-dns\-gehirn\-propagation\-seconds DNS_GEHIRN_PROPAGATION_SECONDS The number of seconds to wait for DNS to propagate before asking the ACME server to verify the DNS record. (default: 30) \-\-dns\-gehirn\-credentials DNS_GEHIRN_CREDENTIALS Gehirn Infrastructure Service credentials file. (default: None) dns\-google: Obtain certificates using a DNS TXT record (if you are using Google Cloud DNS for DNS). \-\-dns\-google\-propagation\-seconds DNS_GOOGLE_PROPAGATION_SECONDS The number of seconds to wait for DNS to propagate before asking the ACME server to verify the DNS record. (default: 60) \-\-dns\-google\-credentials DNS_GOOGLE_CREDENTIALS Path to Google Cloud DNS service account JSON file to use instead of relying on Application Default Credentials (ADC). (See https://cloud.google.com/docs/ authentication/application\-default\-credentials for information about ADC, https://developers.google.com/i dentity/protocols/OAuth2ServiceAccount#creatinganaccou nt for information about creating a service account, and https://cloud.google.com/dns/access\- control#permissions_and_roles for information about the permissions required to modify Cloud DNS records.) (default: None) \-\-dns\-google\-project DNS_GOOGLE_PROJECT The ID of the Google Cloud project that the Google Cloud DNS managed zone(s) reside in. This will be determined automatically if not specified. (default: None) dns\-linode: Obtain certificates using a DNS TXT record (if you are using Linode for DNS). \-\-dns\-linode\-propagation\-seconds DNS_LINODE_PROPAGATION_SECONDS The number of seconds to wait for DNS to propagate before asking the ACME server to verify the DNS record. (default: 120) \-\-dns\-linode\-credentials DNS_LINODE_CREDENTIALS Linode credentials INI file. (default: None) dns\-luadns: Obtain certificates using a DNS TXT record (if you are using LuaDNS for DNS). \-\-dns\-luadns\-propagation\-seconds DNS_LUADNS_PROPAGATION_SECONDS The number of seconds to wait for DNS to propagate before asking the ACME server to verify the DNS record. (default: 30) \-\-dns\-luadns\-credentials DNS_LUADNS_CREDENTIALS LuaDNS credentials INI file. (default: None) dns\-nsone: Obtain certificates using a DNS TXT record (if you are using NS1 for DNS). \-\-dns\-nsone\-propagation\-seconds DNS_NSONE_PROPAGATION_SECONDS The number of seconds to wait for DNS to propagate before asking the ACME server to verify the DNS record. (default: 30) \-\-dns\-nsone\-credentials DNS_NSONE_CREDENTIALS NS1 credentials file. (default: None) dns\-ovh: Obtain certificates using a DNS TXT record (if you are using OVH for DNS). \-\-dns\-ovh\-propagation\-seconds DNS_OVH_PROPAGATION_SECONDS The number of seconds to wait for DNS to propagate before asking the ACME server to verify the DNS record. (default: 120) \-\-dns\-ovh\-credentials DNS_OVH_CREDENTIALS OVH credentials INI file. (default: None) dns\-rfc2136: Obtain certificates using a DNS TXT record (if you are using BIND for DNS). \-\-dns\-rfc2136\-propagation\-seconds DNS_RFC2136_PROPAGATION_SECONDS The number of seconds to wait for DNS to propagate before asking the ACME server to verify the DNS record. (default: 60) \-\-dns\-rfc2136\-credentials DNS_RFC2136_CREDENTIALS RFC 2136 credentials INI file. (default: None) dns\-route53: Obtain certificates using a DNS TXT record (if you are using AWS Route53 for DNS). dns\-sakuracloud: Obtain certificates using a DNS TXT record (if you are using Sakura Cloud for DNS). \-\-dns\-sakuracloud\-propagation\-seconds DNS_SAKURACLOUD_PROPAGATION_SECONDS The number of seconds to wait for DNS to propagate before asking the ACME server to verify the DNS record. (default: 90) \-\-dns\-sakuracloud\-credentials DNS_SAKURACLOUD_CREDENTIALS Sakura Cloud credentials file. (default: None) manual: Authenticate through manual configuration or custom shell scripts. When using shell scripts, an authenticator script must be provided. The environment variables available to this script depend on the type of challenge. $CERTBOT_DOMAIN will always contain the domain being authenticated. For HTTP\-01 and DNS\-01, $CERTBOT_VALIDATION is the validation string, and $CERTBOT_TOKEN is the filename of the resource requested when performing an HTTP\-01 challenge. An additional cleanup script can also be provided and can use the additional variable $CERTBOT_AUTH_OUTPUT which contains the stdout output from the auth script. For both authenticator and cleanup script, on HTTP\-01 and DNS\-01 challenges, $CERTBOT_REMAINING_CHALLENGES will be equal to the number of challenges that remain after the current one, and $CERTBOT_ALL_DOMAINS contains a comma\-separated list of all domains that are challenged for the current certificate. \-\-manual\-auth\-hook MANUAL_AUTH_HOOK Path or command to execute for the authentication script (default: None) \-\-manual\-cleanup\-hook MANUAL_CLEANUP_HOOK Path or command to execute for the cleanup script (default: None) nginx: Nginx Web Server plugin \-\-nginx\-server\-root NGINX_SERVER_ROOT Nginx server root directory. (default: /etc/nginx or /usr/local/etc/nginx) \-\-nginx\-ctl NGINX_CTL Path to the \(aqnginx\(aq binary, used for \(aqconfigtest\(aq and retrieving nginx version number. (default: nginx) \-\-nginx\-sleep\-seconds NGINX_SLEEP_SECONDS Number of seconds to wait for nginx configuration changes to apply when reloading. (default: 1) null: Null Installer standalone: Runs an HTTP server locally which serves the necessary validation files under the /.well\-known/acme\-challenge/ request path. Suitable if there is no HTTP server already running. HTTP challenge only (wildcards not supported). webroot: Saves the necessary validation files to a .well\-known/acme\-challenge/ directory within the nominated webroot path. A seperate HTTP server must be running and serving files from the webroot path. HTTP challenge only (wildcards not supported). \-\-webroot\-path WEBROOT_PATH, \-w WEBROOT_PATH public_html / webroot path. This can be specified multiple times to handle different domains; each domain will have the webroot path that preceded it. For instance: \(ga\-w /var/www/example \-d example.com \-d www.example.com \-w /var/www/thing \-d thing.net \-d m.thing.net\(ga (default: Ask) \-\-webroot\-map WEBROOT_MAP JSON dictionary mapping domains to webroot paths; this implies \-d for each entry. You may need to escape this from your shell. E.g.: \-\-webroot\-map \(aq{\(dqeg1.is,m.eg1.is\(dq:\(dq/www/eg1/\(dq, \(dqeg2.is\(dq:\(dq/www/eg2\(dq}\(aq This option is merged with, but takes precedence over, \-w / \-d entries. At present, if you put webroot\-map in a config file, it needs to be on a single line, like: webroot\-map = {\(dqexample.com\(dq:\(dq/var/www\(dq}. (default: {}) .EE .UNINDENT .UNINDENT .SS Getting help .sp If you\(aqre having problems, we recommend posting on the Let\(aqs Encrypt \fI\%Community Forum\fP\&. .sp If you find a bug in the software, please do report it in our \fI\%issue tracker\fP\&. Remember to give us as much information as possible: .INDENT 0.0 .IP \(bu 2 copy and paste exact command line used and the output (though mind that the latter might include some personally identifiable information, including your email and domains) .IP \(bu 2 copy and paste logs from \fB/var/log/letsencrypt\fP (though mind they also might contain personally identifiable information) .IP \(bu 2 copy and paste \fBcertbot \-\-version\fP output .IP \(bu 2 your operating system, including specific version .IP \(bu 2 specify which installation method you\(aqve chosen .UNINDENT .SH DEVELOPER GUIDE .SS Table of Contents .INDENT 0.0 .IP \(bu 2 \fI\%Getting Started\fP .INDENT 2.0 .IP \(bu 2 \fI\%Running a local copy of the client\fP .IP \(bu 2 \fI\%Find issues to work on\fP .IP \(bu 2 \fI\%Testing\fP .INDENT 2.0 .IP \(bu 2 \fI\%Running automated unit tests\fP .IP \(bu 2 \fI\%Running automated integration tests\fP .IP \(bu 2 \fI\%Running manual integration tests\fP .IP \(bu 2 \fI\%Running tests in CI\fP .UNINDENT .UNINDENT .IP \(bu 2 \fI\%Code components and layout\fP .INDENT 2.0 .IP \(bu 2 \fI\%Plugin\-architecture\fP .IP \(bu 2 \fI\%Authenticators\fP .IP \(bu 2 \fI\%Installer\fP .IP \(bu 2 \fI\%Installer Development\fP .IP \(bu 2 \fI\%Writing your own plugin\fP .INDENT 2.0 .IP \(bu 2 \fI\%Writing your own plugin snap\fP .UNINDENT .UNINDENT .IP \(bu 2 \fI\%Coding style\fP .IP \(bu 2 \fI\%Use certbot.compat.os instead of os\fP .IP \(bu 2 \fI\%Mypy type annotations\fP .IP \(bu 2 \fI\%Submitting a pull request\fP .IP \(bu 2 \fI\%Asking for help\fP .IP \(bu 2 \fI\%Building the Certbot and DNS plugin snaps\fP .IP \(bu 2 \fI\%Updating the documentation\fP .IP \(bu 2 \fI\%Certbot\(aqs dependencies\fP .INDENT 2.0 .IP \(bu 2 \fI\%Updating dependency versions\fP .IP \(bu 2 \fI\%Choosing dependency versions\fP .UNINDENT .UNINDENT .SS Getting Started .sp Certbot has the same \fI\%system requirements\fP when set up for development. While the section below will help you install Certbot and its dependencies, Certbot needs to be run on a UNIX\-like OS so if you\(aqre using Windows, you\(aqll need to set up a (virtual) machine running an OS such as Linux and continue with these instructions on that UNIX\-like OS. .SS Running a local copy of the client .sp Running the client in developer mode from your local tree is a little different than running Certbot as a user. To get set up, clone our git repository by running: .INDENT 0.0 .INDENT 3.5 .sp .EX git clone https://github.com/certbot/certbot .EE .UNINDENT .UNINDENT .sp If you\(aqre running on a UNIX\-like OS, you can run the following commands to install dependencies and set up a virtual environment where you can run Certbot. .sp Install and configure the OS system dependencies required to run Certbot. .INDENT 0.0 .INDENT 3.5 .sp .EX # For APT\-based distributions (e.g. Debian, Ubuntu ...) sudo apt update sudo apt install python3\-venv libaugeas0 # For RPM\-based distributions (e.g. Fedora, CentOS ...) # NB1: old distributions will use yum instead of dnf # NB2: RHEL\-based distributions use python3X instead of python3 (e.g. python38) sudo dnf install python3 augeas\-libs # For macOS installations with Homebrew already installed and configured # NB: If you also run \(gabrew install python\(ga you don\(aqt need the ~/lib # directory created below, however, Certbot\(aqs Apache plugin won\(aqt work # if you use Python installed from other sources such as pyenv or the # version provided by Apple. brew install augeas mkdir ~/lib ln \-s $(brew \-\-prefix)/lib/libaugeas* ~/lib .EE .UNINDENT .UNINDENT .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 If you have trouble creating the virtual environment below, you may need to install additional dependencies. See the \fI\%cryptography project\(aqs site\fP for more information. .UNINDENT .UNINDENT .sp Set up the Python virtual environment that will host your Certbot local instance. .INDENT 0.0 .INDENT 3.5 .sp .EX cd certbot python tools/venv.py .EE .UNINDENT .UNINDENT .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 You may need to repeat this when Certbot\(aqs dependencies change or when a new plugin is introduced. .UNINDENT .UNINDENT .sp You can now run the copy of Certbot from git either by executing \fBvenv/bin/certbot\fP, or by activating the virtual environment. You can do the latter by running: .INDENT 0.0 .INDENT 3.5 .sp .EX source venv/bin/activate .EE .UNINDENT .UNINDENT .sp After running this command, \fBcertbot\fP and development tools like \fBipdb3\fP, \fBipython\fP, \fBpytest\fP, and \fBtox\fP are available in the shell where you ran the command. These tools are installed in the virtual environment and are kept separate from your global Python installation. This works by setting environment variables so the right executables are found and Python can pull in the versions of various packages needed by Certbot. More information can be found in the \fI\%virtualenv docs\fP\&. .SS Find issues to work on .sp You can find the open issues in the \fI\%github issue tracker\fP\&. Comparatively easy ones are marked \fI\%good first issue\fP\&. If you\(aqre starting work on something, post a comment to let others know and seek feedback on your plan where appropriate. .sp Once you\(aqve got a working branch, you can open a pull request. All changes in your pull request must have thorough unit test coverage, pass our tests, and be compliant with the \fI\%coding style\fP\&. .SS Testing .sp You can test your code in several ways: .INDENT 0.0 .IP \(bu 2 running the \fI\%automated unit\fP tests, .IP \(bu 2 running the \fI\%automated integration\fP tests .IP \(bu 2 running an \fIad hoc\fP \fI\%manual integration\fP test .UNINDENT .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 Running integration tests does not currently work on macOS. See \fI\%https://github.com/certbot/certbot/issues/6959\fP\&. In the meantime, we recommend developers on macOS open a PR to run integration tests. .UNINDENT .UNINDENT .SS Running automated unit tests .sp When you are working in a file \fBfoo.py\fP, there should also be a file \fBfoo_test.py\fP either in the same directory as \fBfoo.py\fP or in the \fBtests\fP subdirectory (if there isn\(aqt, make one). While you are working on your code and tests, run \fBpython foo_test.py\fP to run the relevant tests. .sp For debugging, we recommend putting \fBimport ipdb; ipdb.set_trace()\fP statements inside the source code. .sp Once you are done with your code changes, and the tests in \fBfoo_test.py\fP pass, run all of the unit tests for Certbot and check for coverage with \fBtox \-e cover\fP\&. You should then check for code style with \fBtox \-e lint\fP (all files) or \fBpylint \-\-rcfile=.pylintrc path/to/file.py\fP (single file at a time). .sp Once all of the above is successful, you may run the full test suite using \fBtox \-\-skip\-missing\-interpreters\fP\&. We recommend running the commands above first, because running all tests like this is very slow, and the large amount of output can make it hard to find specific failures when they happen. .sp \fBWARNING:\fP .INDENT 0.0 .INDENT 3.5 The full test suite may attempt to modify your system\(aqs Apache config if your user has sudo permissions, so it should not be run on a production Apache server. .UNINDENT .UNINDENT .SS Running automated integration tests .sp Generally it is sufficient to open a pull request and let Github and Azure Pipelines run integration tests for you. However, you may want to run them locally before submitting your pull request. You need Docker and docker\-compose installed and working. .sp The tox environment \fBintegration\fP will setup \fI\%Pebble\fP, the Let\(aqs Encrypt ACME CA server for integration testing, then launch the Certbot integration tests. .sp With a user allowed to access your local Docker daemon, run: .INDENT 0.0 .INDENT 3.5 .sp .EX tox \-e integration .EE .UNINDENT .UNINDENT .sp Tests will be run using pytest. A test report and a code coverage report will be displayed at the end of the integration tests execution. .SS Running manual integration tests .sp You can also manually execute Certbot against a local instance of the \fI\%Pebble\fP ACME server. This is useful to verify that the modifications done to the code makes Certbot behave as expected. .sp To do so you need: .INDENT 0.0 .IP \(bu 2 Docker installed, and a user with access to the Docker client, .IP \(bu 2 an available \fI\%local copy\fP of Certbot. .UNINDENT .sp The virtual environment set up with \fBpython tools/venv.py\fP contains two CLI tools that can be used once the virtual environment is activated: .INDENT 0.0 .INDENT 3.5 .sp .EX run_acme_server .EE .UNINDENT .UNINDENT .INDENT 0.0 .IP \(bu 2 Starts a local instance of Pebble and runs in the foreground printing its logs. .IP \(bu 2 Press CTRL+C to stop this instance. .IP \(bu 2 This instance is configured to validate challenges against certbot executed locally. .UNINDENT .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 Some options are available to tweak the local ACME server. You can execute \fBrun_acme_server \-\-help\fP to see the inline help of the \fBrun_acme_server\fP tool. .UNINDENT .UNINDENT .INDENT 0.0 .INDENT 3.5 .sp .EX certbot_test [ARGS...] .EE .UNINDENT .UNINDENT .INDENT 0.0 .IP \(bu 2 Execute certbot with the provided arguments and other arguments useful for testing purposes, such as: verbose output, full tracebacks in case Certbot crashes, \fIetc.\fP .IP \(bu 2 Execution is preconfigured to interact with the Pebble CA started with \fBrun_acme_server\fP\&. .IP \(bu 2 Any arguments can be passed as they would be to Certbot (eg. \fBcertbot_test certonly \-d test.example.com\fP). .UNINDENT .sp Here is a typical workflow to verify that Certbot successfully issued a certificate using an HTTP\-01 challenge on a machine with Python 3: .INDENT 0.0 .INDENT 3.5 .sp .EX python tools/venv.py source venv/bin/activate run_acme_server & certbot_test certonly \-\-standalone \-d test.example.com # To stop Pebble, launch \(gafg\(ga to get back the background job, then press CTRL+C .EE .UNINDENT .UNINDENT .SS Running tests in CI .sp Certbot uses Azure Pipelines to run continuous integration tests. If you are using our Azure setup, a branch whose name starts with \fBtest\-\fP will run all tests on that branch. .SS Code components and layout .sp The following components of the Certbot repository are distributed to users: .INDENT 0.0 .TP .B acme contains all protocol specific code .TP .B certbot main client code .TP .B certbot\-apache and certbot\-nginx client code to configure specific web servers .TP .B certbot\-dns\-* client code to configure DNS providers .TP .B windows installer Installs Certbot on Windows and is built using the files in windows\-installer/ .UNINDENT .SS Plugin\-architecture .sp Certbot has a plugin architecture to facilitate support for different webservers, other TLS servers, and operating systems. The interfaces available for plugins to implement are defined in \fI\%interfaces.py\fP and \fI\%plugins/common.py\fP\&. .sp The main two plugin interfaces are \fI\%Authenticator\fP, which implements various ways of proving domain control to a certificate authority, and \fI\%Installer\fP, which configures a server to use a certificate once it is issued. Some plugins, like the built\-in Apache and Nginx plugins, implement both interfaces and perform both tasks. Others, like the built\-in Standalone authenticator, implement just one interface. .SS Authenticators .sp Authenticators are plugins that prove control of a domain name by solving a challenge provided by the ACME server. ACME currently defines several types of challenges: HTTP, TLS\-ALPN, and DNS, represented by classes in \fBacme.challenges\fP\&. An authenticator plugin should implement support for at least one challenge type. .sp An Authenticator indicates which challenges it supports by implementing \fBget_chall_pref(domain)\fP to return a sorted list of challenge types in preference order. .sp An Authenticator must also implement \fBperform(achalls)\fP, which \(dqperforms\(dq a list of challenges by, for instance, provisioning a file on an HTTP server, or setting a TXT record in DNS. Once all challenges have succeeded or failed, Certbot will call the plugin\(aqs \fBcleanup(achalls)\fP method to remove any files or DNS records that were needed only during authentication. .SS Installer .sp Installers plugins exist to actually setup the certificate in a server, possibly tweak the security configuration to make it more correct and secure (Fix some mixed content problems, turn on HSTS, redirect to HTTPS, etc). Installer plugins tell the main client about their abilities to do the latter via the \fI\%supported_enhancements()\fP call. We currently have two Installers in the tree, the \fBApacheConfigurator\fP\&. and the \fBNginxConfigurator\fP\&. External projects have made some progress toward support for IIS, Icecast and Plesk. .sp Installers and Authenticators will oftentimes be the same class/object (because for instance both tasks can be performed by a webserver like nginx) though this is not always the case (the standalone plugin is an authenticator that listens on port 80, but it cannot install certificates; a postfix plugin would be an installer but not an authenticator). .sp Installers and Authenticators are kept separate because it should be possible to use the \fBStandaloneAuthenticator\fP (it sets up its own Python server to perform challenges) with a program that cannot solve challenges itself (Such as MTA installers). .SS Installer Development .sp There are a few existing classes that may be beneficial while developing a new \fI\%Installer\fP\&. Installers aimed to reconfigure UNIX servers may use Augeas for configuration parsing and can inherit from \fBAugeasConfigurator\fP class to handle much of the interface. Installers that are unable to use Augeas may still find the \fI\%Reverter\fP class helpful in handling configuration checkpoints and rollback. .SS Writing your own plugin .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 The Certbot team is not currently accepting any new plugins because we want to rethink our approach to the challenge and resolve some issues like \fI\%#6464\fP, \fI\%#6503\fP, and \fI\%#6504\fP first. .sp In the meantime, you\(aqre welcome to release it as a third\-party plugin. See \fI\%certbot\-dns\-ispconfig\fP for one example of that. .UNINDENT .UNINDENT .sp Certbot client supports dynamic discovery of plugins through the \fI\%importlib.metadata entry points\fP using the \fI\%certbot.plugins\fP group. This way you can, for example, create a custom implementation of \fI\%Authenticator\fP or the \fI\%Installer\fP without having to merge it with the core upstream source code. An example is provided in \fBexamples/plugins/\fP directory. .sp While developing, you can install your plugin into a Certbot development virtualenv like this: .INDENT 0.0 .INDENT 3.5 .sp .EX \&. venv/bin/activate pip install \-e examples/plugins/ certbot_test plugins .EE .UNINDENT .UNINDENT .sp Your plugin should show up in the output of the last command. If not, it was not installed properly. .sp Once you\(aqve finished your plugin and published it, you can have your users install it system\-wide with \fBpip install\fP\&. Note that this will only work for users who have Certbot installed from OS packages or via pip. .SS Writing your own plugin snap .sp If you\(aqd like your plugin to be used alongside the Certbot snap, you will also have to publish your plugin as a snap. Plugin snaps are regular confined snaps, but normally do not provide any \(dqapps\(dq themselves. Plugin snaps export loadable Python modules to the Certbot snap. .sp When the Certbot snap runs, it will use its version of Python and prefer Python modules contained in its own snap over modules contained in external snaps. This means that your snap doesn\(aqt have to contain things like an extra copy of Python, Certbot, or their dependencies, but also that if you need a different version of a dependency than is already installed in the Certbot snap, the Certbot snap will have to be updated. .sp Certbot plugin snaps expose their Python modules to the Certbot snap via a \fI\%snap content interface\fP where \fBcertbot\-1\fP is the value for the \fBcontent\fP attribute. The Certbot snap only uses this to find the names of connected plugin snaps and it expects to find the Python modules to be loaded under \fBlib/python3.8/site\-packages/\fP in the plugin snap. This location is the default when using the \fBcore20\fP \fI\%base snap\fP and the \fI\%python snapcraft plugin\fP\&. .sp The Certbot snap also provides a separate content interface which you can use to get metadata about the Certbot snap using the \fBcontent\fP identifier \fBmetadata\-1\fP\&. .sp The script used to generate the snapcraft.yaml files for our own externally snapped plugins can be found at \fI\%https://github.com/certbot/certbot/blob/master/tools/snap/generate_dnsplugins_snapcraft.sh\fP\&. .sp For more information on building externally snapped plugins, see the section on \fI\%Building the Certbot and DNS plugin snaps\fP\&. .sp Once you have created your own snap, if you have the snap file locally, it can be installed for use with Certbot by running: .INDENT 0.0 .INDENT 3.5 .sp .EX snap install \-\-classic certbot snap set certbot trust\-plugin\-with\-root=ok snap install \-\-dangerous your\-snap\-filename.snap sudo snap connect certbot:plugin your\-snap\-name sudo /snap/bin/certbot plugins .EE .UNINDENT .UNINDENT .sp If everything worked, the last command should list your plugin in the list of plugins found by Certbot. Once your snap is published to the snap store, it will be installable through the name of the snap on the snap store without the \fB\-\-dangerous\fP flag. If you are also using Certbot\(aqs metadata interface, you can run \fBsudo snap connect your\-snap\-name:your\-plug\-name\-for\-metadata certbot:certbot\-metadata\fP to connect your snap to it. .SS Coding style .sp Please: .INDENT 0.0 .IP 1. 3 \fBBe consistent with the rest of the code\fP\&. .IP 2. 3 Read \fI\%PEP 8 \- Style Guide for Python Code\fP\&. .IP 3. 3 Follow the \fI\%Google Python Style Guide\fP, with the exception that we use \fI\%Sphinx\-style\fP documentation: .INDENT 3.0 .INDENT 3.5 .sp .EX def foo(arg): \(dq\(dq\(dqShort description. :param int arg: Some number. :returns: Argument :rtype: int \(dq\(dq\(dq return arg .EE .UNINDENT .UNINDENT .IP 4. 3 Remember to use \fBpylint\fP\&. .IP 5. 3 You may consider installing a plugin for \fI\%editorconfig\fP in your editor to prevent some linting warnings. .IP 6. 3 Please avoid \fBunittest.assertTrue\fP or \fBunittest.assertFalse\fP when possible, and use \fBassertEqual\fP or more specific assert. They give better messages when it\(aqs failing, and are generally more correct. .UNINDENT .SS Use \fBcertbot.compat.os\fP instead of \fBos\fP .sp Python\(aqs standard library \fBos\fP module lacks full support for several Windows security features about file permissions (eg. DACLs). However several files handled by Certbot (eg. private keys) need strongly restricted access on both Linux and Windows. .sp To help with this, the \fBcertbot.compat.os\fP module wraps the standard \fBos\fP module, and forbids usage of methods that lack support for these Windows security features. .sp As a developer, when working on Certbot or its plugins, you must use \fBcertbot.compat.os\fP in every place you would need \fBos\fP (eg. \fBfrom certbot.compat import os\fP instead of \fBimport os\fP). Otherwise the tests will fail when your PR is submitted. .SS Mypy type annotations .sp Certbot uses the \fI\%mypy\fP static type checker. Python 3 natively supports official type annotations, which can then be tested for consistency using mypy. Mypy does some type checks even without type annotations; we can find bugs in Certbot even without a fully annotated codebase. .sp Zulip wrote a \fI\%great guide\fP to using mypy. It’s useful, but you don’t have to read the whole thing to start contributing to Certbot. .sp To run mypy on Certbot, use \fBtox \-e mypy\fP on a machine that has Python 3 installed. .sp Also note that OpenSSL, which we rely on, has type definitions for crypto but not SSL. We use both. Those imports should look like this: .INDENT 0.0 .INDENT 3.5 .sp .EX from OpenSSL import crypto from OpenSSL import SSL .EE .UNINDENT .UNINDENT .SS Submitting a pull request .sp Steps: .INDENT 0.0 .IP 0. 4 We recommend you talk with us in a GitHub issue or \fI\%Mattermost\fP before writing a pull request to ensure the changes you\(aqre making is something we have the time and interest to review. .IP 1. 4 Write your code! When doing this, you should add \fI\%mypy type annotations\fP for any functions you add or modify. You can check that you\(aqve done this correctly by running \fBtox \-e mypy\fP on a machine that has Python 3 installed. .IP 2. 4 Make sure your environment is set up properly and that you\(aqre in your virtualenv. You can do this by following the instructions in the \fI\%Getting Started\fP section. .IP 3. 4 Run \fBtox \-e lint\fP to check for pylint errors. Fix any errors. .IP 4. 4 Run \fBtox \-\-skip\-missing\-interpreters\fP to run all the tests we recommend developers run locally. The \fB\-\-skip\-missing\-interpreters\fP argument ignores missing versions of Python needed for running the tests. Fix any errors. .IP 5. 4 If any documentation should be added or updated as part of the changes you have made, please include the documentation changes in your PR. .IP 6. 4 Submit the PR. Once your PR is open, please do not force push to the branch containing your pull request to squash or amend commits. We use \fI\%squash merges\fP on PRs and rewriting commits makes changes harder to track between reviews. .IP 7. 4 Did your tests pass on Azure Pipelines? If they didn\(aqt, fix any errors. .UNINDENT .SS Asking for help .sp If you have any questions while working on a Certbot issue, don\(aqt hesitate to ask for help! You can do this in the Certbot channel in EFF\(aqs Mattermost instance for its open source projects as described below. .sp You can get involved with several of EFF\(aqs software projects such as Certbot at the \fI\%EFF Open Source Contributor Chat Platform\fP\&. By signing up for the EFF Open Source Contributor Chat Platform, you consent to share your personal information with the Electronic Frontier Foundation, which is the operator and data controller for this platform. The channels will be available both to EFF, and to other users of EFFOSCCP, who may use or disclose information in these channels outside of EFFOSCCP. EFF will use your information, according to the \fI\%Privacy Policy\fP, to further the mission of EFF, including hosting and moderating the discussions on this platform. .sp Use of EFFOSCCP is subject to the \fI\%EFF Code of Conduct\fP\&. When investigating an alleged Code of Conduct violation, EFF may review discussion channels or direct messages. .SS Building the Certbot and DNS plugin snaps .sp Instructions for how to manually build and run the Certbot snap and the externally snapped DNS plugins that the Certbot project supplies are located in the README file at \fI\%https://github.com/certbot/certbot/tree/master/tools/snap\fP\&. .SS Updating the documentation .sp Many of the packages in the Certbot repository have documentation in a \fBdocs/\fP directory. This directory is located under the top level directory for the package. For instance, Certbot\(aqs documentation is under \fBcertbot/docs\fP\&. .sp To build the documentation of a package, make sure you have followed the instructions to set up a \fI\%local copy\fP of Certbot including activating the virtual environment. After that, \fBcd\fP to the docs directory you want to build and run the command: .INDENT 0.0 .INDENT 3.5 .sp .EX make clean html .EE .UNINDENT .UNINDENT .sp This would generate the HTML documentation in \fB_build/html\fP in your current \fBdocs/\fP directory. .SS Certbot\(aqs dependencies .sp We attempt to pin all of Certbot\(aqs dependencies whenever we can for reliability and consistency. Some of the places we have Certbot\(aqs dependencies pinned include our snaps, Docker images, Windows installer, CI, and our development environments. .sp In most cases, the file where dependency versions are specified is \fBtools/requirements.txt\fP\&. The one exception to this is our \(dqoldest\(dq tests where \fBtools/oldest_constraints.txt\fP is used instead. The purpose of the \(dqoldest\(dq tests is to ensure Certbot continues to work with the oldest versions of our dependencies which we claim to support. The oldest versions of the dependencies we support should also be declared in our setup.py files to communicate this information to our users. .sp The choices of whether Certbot\(aqs dependencies are pinned and what file is used if they are should be automatically handled for you most of the time by Certbot\(aqs tooling. The way it works though is \fBtools/pip_install.py\fP (which many of our other tools build on) checks for the presence of environment variables. If \fBCERTBOT_OLDEST\fP is set to 1, \fBtools/oldest_constraints.txt\fP will be used as constraints for \fBpip\fP, otherwise, \fBtools/requirements.txt\fP is used as constraints. .SS Updating dependency versions .sp \fBtools/requirements.txt\fP and \fBtools/oldest_constraints.txt\fP can be updated using \fBtools/pinning/current/repin.sh\fP and \fBtools/pinning/oldest/repin.sh\fP respectively. This works by using \fBpoetry\fP to generate pinnings based on a Poetry project defined by the \fBpyproject.toml\fP file in the same directory as the script. In many cases, you can just run the script to generate updated dependencies, however, if you need to pin back packages or unpin packages that were previously restricted to an older version, you will need to modify the \fBpyproject.toml\fP file. The syntax used by this file is described at \fI\%https://python\-poetry.org/docs/pyproject/\fP and how dependencies are specified in this file is further described at \fI\%https://python\-poetry.org/docs/dependency\-specification/\fP\&. .sp If you want to learn more about the design used here, see \fBtools/pinning/DESIGN.md\fP in the Certbot repo. .SS Choosing dependency versions .sp A number of Unix distributions create third\-party Certbot packages for their users. Where feasible, the Certbot project tries to manage its dependencies in a way that does not create avoidable work for packagers. .sp Avoiding adding new dependencies is a good way to help with this. .sp When adding new or upgrading existing Python dependencies, Certbot developers should pay attention to which distributions are actively packaging Certbot. In particular: .INDENT 0.0 .IP \(bu 2 EPEL (used by RHEL/CentOS/Fedora) updates Certbot regularly. At the time of writing, EPEL9 is the release of EPEL where Certbot is being updated, but check the \fI\%EPEL home page\fP and \fI\%pkgs.org\fP for the latest release. .IP \(bu 2 Debian and Ubuntu only package Certbot when making new releases of their distros. Checking the available version of dependencies in Debian \(dqsid\(dq and \(dqunstable\(dq can help to identify dependencies that are likely to be available in the next stable release of these distros. .UNINDENT .sp If a dependency is already packaged in these distros and is acceptable for use in Certbot, the oldest packaged version of that dependency should be chosen and set as the minimum version in \fBsetup.py\fP\&. .SH PACKAGING GUIDE .SS Releases .sp We release packages and upload them to PyPI (wheels and source tarballs). .INDENT 0.0 .IP \(bu 2 \fI\%https://pypi.org/project/acme/\fP .IP \(bu 2 \fI\%https://pypi.org/project/certbot/\fP .IP \(bu 2 \fI\%https://pypi.org/project/certbot\-apache/\fP .IP \(bu 2 \fI\%https://pypi.org/project/certbot\-nginx/\fP .IP \(bu 2 \fI\%https://pypi.org/project/certbot\-dns\-cloudflare/\fP .IP \(bu 2 \fI\%https://pypi.org/project/certbot\-dns\-digitalocean/\fP .IP \(bu 2 \fI\%https://pypi.org/project/certbot\-dns\-dnsimple/\fP .IP \(bu 2 \fI\%https://pypi.org/project/certbot\-dns\-dnsmadeeasy/\fP .IP \(bu 2 \fI\%https://pypi.org/project/certbot\-dns\-google/\fP .IP \(bu 2 \fI\%https://pypi.org/project/certbot\-dns\-linode/\fP .IP \(bu 2 \fI\%https://pypi.org/project/certbot\-dns\-luadns/\fP .IP \(bu 2 \fI\%https://pypi.org/project/certbot\-dns\-nsone/\fP .IP \(bu 2 \fI\%https://pypi.org/project/certbot\-dns\-ovh/\fP .IP \(bu 2 \fI\%https://pypi.org/project/certbot\-dns\-rfc2136/\fP .IP \(bu 2 \fI\%https://pypi.org/project/certbot\-dns\-route53/\fP .UNINDENT .sp The following scripts are used in the process: .INDENT 0.0 .IP \(bu 2 \fI\%https://github.com/certbot/certbot/blob/master/tools/release.sh\fP .UNINDENT .sp We use git tags to identify releases, using \fI\%Semantic Versioning\fP\&. For example: \fBv0.11.1\fP\&. .sp Since version 1.21.0, our packages are cryptographically signed by one of four PGP keys: .INDENT 0.0 .IP \(bu 2 \fBBF6BCFC89E90747B9A680FD7B6029E8500F7DB16\fP .IP \(bu 2 \fB86379B4F0AF371B50CD9E5FF3402831161D1D280\fP .IP \(bu 2 \fB20F201346BF8F3F455A73F9A780CC99432A28621\fP .IP \(bu 2 \fBF2871B4152AE13C49519111F447BF683AA3B26C3\(ga\fP .UNINDENT .sp These keys can be found on major key servers and at \fI\%https://dl.eff.org/certbot.pub\fP\&. .sp Releases before 1.21.0 were signed by the PGP key \fBA2CFB51FA275A7286234E7B24D17C995CD9775F2\fP which can still be found on major key servers. .SS Notes for package maintainers .INDENT 0.0 .IP 0. 4 Please use our tagged releases, not \fBmaster\fP! .IP 1. 4 Do not package \fBcertbot\-compatibility\-test\fP as it\(aqs only used internally. .IP 2. 4 To run tests on our packages, you should use pytest by running the command \fBpython \-m pytest\fP\&. Running \fBpytest\fP directly may not work because PYTHONPATH is not handled the same way and local modules may not be found by the test runner. .IP 3. 4 If you\(aqd like to include automated renewal in your package: .UNINDENT .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 \fBcertbot renew \-q\fP should be added to crontab or systemd timer. .IP \(bu 2 A random per\-machine time offset should be included to avoid having a large number of your clients hit Let\(aqs Encrypt\(aqs servers simultaneously. .IP \(bu 2 \fB\-\-preconfigured\-renewal\fP should be included on the CLI or in \fBcli.ini\fP for all invocations of Certbot, so that it can adjust its interactive output regarding automated renewal (Certbot >= 1.9.0). .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .IP 4. 3 \fBjws\fP is an internal script for \fBacme\fP module and it doesn\(aqt have to be packaged \- it\(aqs mostly for debugging: you can use it as \fBecho foo | jws sign | jws verify\fP\&. .IP 5. 3 Do get in touch with us. We are happy to make any changes that will make packaging easier. If you need to apply some patches don\(aqt do it downstream \- make a PR here. .UNINDENT .SH BACKWARDS COMPATIBILITY .sp All Certbot components including \fI\%acme\fP, Certbot, and \fI\%non\-third party plugins\fP follow \fI\%Semantic Versioning\fP both for its Python \fI\%API\fP and for the application itself. This means that we will not change behavior in a backwards incompatible way except in a new major version of the project. .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 None of this applies to the behavior of Certbot distribution mechanisms such as \fI\%our snaps\fP or OS packages whose behavior may change at any time. Semantic versioning only applies to the common Certbot components that are installed by various distribution methods. .UNINDENT .UNINDENT .sp For Certbot as an application, the command line interface and non\-interactive behavior can be considered stable with two exceptions. The first is that no aspects of Certbot\(aqs console or log output should be considered stable and it may change at any time. The second is that Certbot\(aqs behavior should only be considered stable with certain files but not all. Files with which users should expect Certbot to maintain its current behavior with are: .INDENT 0.0 .IP \(bu 2 \fB/etc/letsencrypt/live/$domain/{cert,chain,fullchain,privkey}.pem\fP, where \fB$domain\fP is the certificate name (see \fI\%Where are my certificates?\fP for more details) .IP \(bu 2 \fI\%CLI configuration files\fP .IP \(bu 2 Hook directories in \fB/etc/letsencrypt/renewal\-hooks\fP .UNINDENT .sp Certbot\(aqs behavior with other files may change at any point. .sp Another area where Certbot should not be considered stable is its behavior when not run in non\-interactive mode which also may change at any point. .sp In general, if we\(aqre making a change that we expect will break some users, we will bump the major version and will have warned about it in a prior release when possible. For our Python API, we will issue warnings using Python\(aqs warning module. For application level changes, we will print and log warning messages. .SH RESOURCES .sp Documentation: \fI\%https://certbot.eff.org/docs\fP .sp Software project: \fI\%https://github.com/certbot/certbot\fP .sp Changelog: \fI\%https://github.com/certbot/certbot/blob/master/certbot/CHANGELOG.md\fP .sp For Contributors: \fI\%https://certbot.eff.org/docs/contributing.html\fP .sp For Users: \fI\%https://certbot.eff.org/docs/using.html\fP .sp Main Website: \fI\%https://certbot.eff.org\fP .sp Let\(aqs Encrypt Website: \fI\%https://letsencrypt.org\fP .sp Community: \fI\%https://community.letsencrypt.org\fP .sp ACME spec: \fI\%RFC 8555\fP .sp ACME working area in github (archived): \fI\%https://github.com/ietf\-wg\-acme/acme\fP .SH API DOCUMENTATION .SS certbot package .sp Certbot client. .SS Subpackages .SS certbot.compat package .sp Compatibility layer to run certbot both on Linux and Windows. .sp This package contains all logic that needs to be implemented specifically for Linux and for Windows. Then the rest of certbot code relies on this module to be platform agnostic. .SS Submodules .SS certbot.compat.filesystem module .sp Compat module to handle files security on Windows and Linux .INDENT 0.0 .TP .B certbot.compat.filesystem.chmod(file_path: str, mode: int) -> None Apply a POSIX mode on given file_path: .INDENT 7.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 for Linux, the POSIX mode will be directly applied using chmod, .IP \(bu 2 for Windows, the POSIX mode will be translated into a Windows DACL that make sense for Certbot context, and applied to the file using kernel calls. .UNINDENT .UNINDENT .UNINDENT .sp The definition of the Windows DACL that correspond to a POSIX mode, in the context of Certbot, is explained at \fI\%https://github.com/certbot/certbot/issues/6356\fP and is implemented by the method \fB_generate_windows_flags()\fP\&. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBfile_path\fP (\fIstr\fP) \-\- Path of the file .IP \(bu 2 \fBmode\fP (\fIint\fP) \-\- POSIX mode to apply .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.compat.filesystem.umask(mask: int) -> int Set the current numeric umask and return the previous umask. On Linux, the built\-in umask method is used. On Windows, our Certbot\-side implementation is used. .INDENT 7.0 .TP .B Parameters \fBmask\fP (\fIint\fP) \-\- The user file\-creation mode mask to apply. .TP .B Return type int .TP .B Returns The previous umask value. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.compat.filesystem.temp_umask(mask: int) -> Generator[None, None, None] Apply a umask temporarily, meant to be used in a \fBwith\fP block. Uses the Certbot implementation of umask. .INDENT 7.0 .TP .B Parameters \fBmask\fP (\fIint\fP) \-\- The user file\-creation mode mask to apply temporarily .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.compat.filesystem.copy_ownership_and_apply_mode(src: str, dst: str, mode: int, copy_user: bool, copy_group: bool) -> None Copy ownership (user and optionally group on Linux) from the source to the destination, then apply given mode in compatible way for Linux and Windows. This replaces the os.chown command. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBsrc\fP (\fIstr\fP) \-\- Path of the source file .IP \(bu 2 \fBdst\fP (\fIstr\fP) \-\- Path of the destination file .IP \(bu 2 \fBmode\fP (\fIint\fP) \-\- Permission mode to apply on the destination file .IP \(bu 2 \fBcopy_user\fP (\fIbool\fP) \-\- Copy user if \fBTrue\fP .IP \(bu 2 \fBcopy_group\fP (\fIbool\fP) \-\- Copy group if \fBTrue\fP on Linux (has no effect on Windows) .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.compat.filesystem.copy_ownership_and_mode(src: str, dst: str, copy_user: bool = True, copy_group: bool = True) -> None Copy ownership (user and optionally group on Linux) and mode/DACL from the source to the destination. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBsrc\fP (\fIstr\fP) \-\- Path of the source file .IP \(bu 2 \fBdst\fP (\fIstr\fP) \-\- Path of the destination file .IP \(bu 2 \fBcopy_user\fP (\fIbool\fP) \-\- Copy user if \fBTrue\fP .IP \(bu 2 \fBcopy_group\fP (\fIbool\fP) \-\- Copy group if \fBTrue\fP on Linux (has no effect on Windows) .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.compat.filesystem.check_mode(file_path: str, mode: int) -> bool Check if the given mode matches the permissions of the given file. On Linux, will make a direct comparison, on Windows, mode will be compared against the security model. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBfile_path\fP (\fIstr\fP) \-\- Path of the file .IP \(bu 2 \fBmode\fP (\fIint\fP) \-\- POSIX mode to test .UNINDENT .TP .B Return type bool .TP .B Returns True if the POSIX mode matches the file permissions .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.compat.filesystem.check_owner(file_path: str) -> bool Check if given file is owned by current user. .INDENT 7.0 .TP .B Parameters \fBfile_path\fP (\fIstr\fP) \-\- File path to check .TP .B Return type bool .TP .B Returns True if given file is owned by current user, False otherwise. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.compat.filesystem.check_permissions(file_path: str, mode: int) -> bool Check if given file has the given mode and is owned by current user. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBfile_path\fP (\fIstr\fP) \-\- File path to check .IP \(bu 2 \fBmode\fP (\fIint\fP) \-\- POSIX mode to check .UNINDENT .TP .B Return type bool .TP .B Returns True if file has correct mode and owner, False otherwise. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.compat.filesystem.open(file_path: str, flags: int, mode: int = 511) -> int Wrapper of original os.open function, that will ensure on Windows that given mode is correctly applied. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBfile_path\fP (\fIstr\fP) \-\- The file path to open .IP \(bu 2 \fBflags\fP (\fIint\fP) \-\- Flags to apply on file while opened .IP \(bu 2 \fBmode\fP (\fIint\fP) \-\- POSIX mode to apply on file when opened, Python defaults will be applied if \fBNone\fP .UNINDENT .TP .B Returns the file descriptor to the opened file .TP .B Return type int .TP .B Raise OSError(errno.EEXIST) if the file already exists and os.O_CREAT & os.O_EXCL are set, OSError(errno.EACCES) on Windows if the file already exists and is a directory, and os.O_CREAT is set. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.compat.filesystem.makedirs(file_path: str, mode: int = 511) -> None Rewrite of original os.makedirs function, that will ensure on Windows that given mode is correctly applied. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBfile_path\fP (\fIstr\fP) \-\- The file path to open .IP \(bu 2 \fBmode\fP (\fIint\fP) \-\- POSIX mode to apply on leaf directory when created, Python defaults will be applied if \fBNone\fP .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.compat.filesystem.mkdir(file_path: str, mode: int = 511) -> None Rewrite of original os.mkdir function, that will ensure on Windows that given mode is correctly applied. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBfile_path\fP (\fIstr\fP) \-\- The file path to open .IP \(bu 2 \fBmode\fP (\fIint\fP) \-\- POSIX mode to apply on directory when created, Python defaults will be applied if \fBNone\fP .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.compat.filesystem.replace(src: str, dst: str) -> None Rename a file to a destination path and handles situations where the destination exists. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBsrc\fP (\fIstr\fP) \-\- The current file path. .IP \(bu 2 \fBdst\fP (\fIstr\fP) \-\- The new file path. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.compat.filesystem.realpath(file_path: str) -> str Find the real path for the given path. This method resolves symlinks, including recursive symlinks, and is protected against symlinks that creates an infinite loop. .INDENT 7.0 .TP .B Parameters \fBfile_path\fP (\fIstr\fP) \-\- The path to resolve .TP .B Returns The real path for the given path .TP .B Return type str .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.compat.filesystem.readlink(link_path: str) -> str Return a string representing the path to which the symbolic link points. .INDENT 7.0 .TP .B Parameters \fBlink_path\fP (\fIstr\fP) \-\- The symlink path to resolve .TP .B Returns The path the symlink points to .TP .B Returns str .TP .B Raise ValueError if a long path (260> characters) is encountered on Windows .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.compat.filesystem.is_executable(path: str) -> bool Is path an executable file? .INDENT 7.0 .TP .B Parameters \fBpath\fP (\fIstr\fP) \-\- path to test .TP .B Returns True if path is an executable file .TP .B Return type bool .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.compat.filesystem.has_world_permissions(path: str) -> bool Check if everybody/world has any right (read/write/execute) on a file given its path. .INDENT 7.0 .TP .B Parameters \fBpath\fP (\fIstr\fP) \-\- path to test .TP .B Returns True if everybody/world has any right to the file .TP .B Return type bool .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.compat.filesystem.compute_private_key_mode(old_key: str, base_mode: int) -> int Calculate the POSIX mode to apply to a private key given the previous private key. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBold_key\fP (\fIstr\fP) \-\- path to the previous private key .IP \(bu 2 \fBbase_mode\fP (\fIint\fP) \-\- the minimum modes to apply to a private key .UNINDENT .TP .B Returns the POSIX mode to apply .TP .B Return type int .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.compat.filesystem.has_same_ownership(path1: str, path2: str) -> bool Return True if the ownership of two files given their respective path is the same. On Windows, ownership is checked against owner only, since files do not have a group owner. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBpath1\fP (\fIstr\fP) \-\- path to the first file .IP \(bu 2 \fBpath2\fP (\fIstr\fP) \-\- path to the second file .UNINDENT .TP .B Returns True if both files have the same ownership, False otherwise .TP .B Return type bool .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.compat.filesystem.has_min_permissions(path: str, min_mode: int) -> bool Check if a file given its path has at least the permissions defined by the given minimal mode. On Windows, group permissions are ignored since files do not have a group owner. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBpath\fP (\fIstr\fP) \-\- path to the file to check .IP \(bu 2 \fBmin_mode\fP (\fIint\fP) \-\- the minimal permissions expected .UNINDENT .TP .B Returns True if the file matches the minimal permissions expectations, False otherwise .TP .B Return type bool .UNINDENT .UNINDENT .SS certbot.compat.misc module .sp This compat module handles various platform specific calls that do not fall into one particular category. .INDENT 0.0 .TP .B certbot.compat.misc.raise_for_non_administrative_windows_rights() -> None On Windows, raise if current shell does not have the administrative rights. Do nothing on Linux. .INDENT 7.0 .TP .B Raises \fB\&.errors.Error\fP \-\- If the current shell does not have administrative rights on Windows. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.compat.misc.prepare_virtual_console() -> None On Windows, ensure that Console Virtual Terminal Sequences are enabled. .UNINDENT .INDENT 0.0 .TP .B certbot.compat.misc.readline_with_timeout(timeout: float, prompt: str | None) -> str Read user input to return the first line entered, or raise after specified timeout. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBtimeout\fP (\fIfloat\fP) \-\- The timeout in seconds given to the user. .IP \(bu 2 \fBprompt\fP (\fIstr\fP) \-\- The prompt message to display to the user. .UNINDENT .TP .B Returns The first line entered by the user. .TP .B Return type str .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.compat.misc.get_default_folder(folder_type: str) -> str Return the relevant default folder for the current OS .INDENT 7.0 .TP .B Parameters \fBfolder_type\fP (\fIstr\fP) \-\- The type of folder to retrieve (config, work or logs) .TP .B Returns The relevant default folder. .TP .B Return type str .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.compat.misc.underscores_for_unsupported_characters_in_path(path: str) -> str Replace unsupported characters in path for current OS by underscores. :param str path: the path to normalize :return: the normalized path :rtype: str .UNINDENT .INDENT 0.0 .TP .B certbot.compat.misc.execute_command_status(cmd_name: str, shell_cmd: str, env: dict | None = None) -> Tuple[int, str, str] .INDENT 7.0 .TP .B Run a command: .INDENT 7.0 .IP \(bu 2 on Linux command will be run by the standard shell selected with subprocess.run(shell=True) .IP \(bu 2 on Windows command will be run in a Powershell shell .UNINDENT .UNINDENT .sp This function returns the exit code, and does not log the result and output of the command. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBcmd_name\fP (\fIstr\fP) \-\- the user facing name of the hook being run .IP \(bu 2 \fBshell_cmd\fP (\fIstr\fP) \-\- shell command to execute .IP \(bu 2 \fBenv\fP (\fIdict\fP) \-\- environ to pass into subprocess.run .UNINDENT .TP .B Returns \fBtuple\fP (\fBint\fP returncode, \fBstr\fP stderr, \fBstr\fP stdout) .UNINDENT .UNINDENT .SS certbot.compat.os module .sp This compat modules is a wrapper of the core os module that forbids usage of specific operations (e.g. chown, chmod, getuid) that would be harmful to the Windows file security model of Certbot. This module is intended to replace standard os module throughout certbot projects (except acme). .sp This module has the same API as the os module in the Python standard library except for the functions defined below. .sp isort:skip_file .INDENT 0.0 .TP .B certbot.compat.os.access(*unused_args, **unused_kwargs) Method os.access() is forbidden .UNINDENT .INDENT 0.0 .TP .B certbot.compat.os.chmod(*unused_args, **unused_kwargs) Method os.chmod() is forbidden .UNINDENT .INDENT 0.0 .TP .B certbot.compat.os.chown(*unused_args, **unused_kwargs) Method os.chown() is forbidden .UNINDENT .INDENT 0.0 .TP .B certbot.compat.os.fstat(*unused_args, **unused_kwargs) Method os.stat() is forbidden .UNINDENT .INDENT 0.0 .TP .B certbot.compat.os.mkdir(*unused_args, **unused_kwargs) Method os.mkdir() is forbidden .UNINDENT .INDENT 0.0 .TP .B certbot.compat.os.open(*unused_args, **unused_kwargs) Method os.open() is forbidden .UNINDENT .INDENT 0.0 .TP .B certbot.compat.os.rename(*unused_args, **unused_kwargs) Method os.rename() is forbidden .UNINDENT .INDENT 0.0 .TP .B certbot.compat.os.replace(*unused_args, **unused_kwargs) Method os.replace() is forbidden .UNINDENT .INDENT 0.0 .TP .B certbot.compat.os.stat(*unused_args, **unused_kwargs) Method os.stat() is forbidden .UNINDENT .INDENT 0.0 .TP .B certbot.compat.os.umask(*unused_args, **unused_kwargs) Method os.chmod() is forbidden .UNINDENT .INDENT 0.0 .TP .B certbot.compat.os.makedirs(*unused_args, **unused_kwargs) Method os.makedirs() is forbidden .UNINDENT .SS certbot.display package .sp Certbot display utilities. .SS Submodules .SS certbot.display.ops module .sp Contains UI methods for LE user operations. .INDENT 0.0 .TP .B certbot.display.ops.get_email(invalid: bool = False, optional: bool = True) -> str Prompt for valid email address. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBinvalid\fP (\fIbool\fP) \-\- True if an invalid address was provided by the user .IP \(bu 2 \fBoptional\fP (\fIbool\fP) \-\- True if the user can use \-\-register\-unsafely\-without\-email to avoid providing an e\-mail .UNINDENT .TP .B Returns e\-mail address .TP .B Return type str .TP .B Raises \fI\%errors.Error\fP \-\- if the user cancels .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.display.ops.choose_account(accounts: List[Account]) -> Account | None Choose an account. .INDENT 7.0 .TP .B Parameters \fBaccounts\fP (\fIlist\fP) \-\- Containing at least one \fBAccount\fP .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.display.ops.choose_values(values: List[str], question: str | None = None) -> List[str] Display screen to let user pick one or multiple values from the provided list. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBvalues\fP (\fIlist\fP) \-\- Values to select from .IP \(bu 2 \fBquestion\fP (\fIstr\fP) \-\- Question to ask to user while choosing values .UNINDENT .TP .B Returns List of selected values .TP .B Return type list .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.display.ops.choose_names(installer: \fI\%Installer\fP | None, question: str | None = None) -> List[str] Display screen to select domains to validate. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBinstaller\fP (\fI\%certbot.interfaces.Installer\fP) \-\- An installer object .IP \(bu 2 \fBquestion\fP (\fIstr\fP) \-\- Overriding default question to ask the user if asked to choose from domain names. .UNINDENT .TP .B Returns List of selected names .TP .B Return type \fBlist\fP of \fBstr\fP .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.display.ops.get_valid_domains(domains: Iterable[str]) -> List[str] .INDENT 7.0 .TP .B Helper method for choose_names that implements basic checks on domain names .UNINDENT .INDENT 7.0 .TP .B Parameters \fBdomains\fP (\fIlist\fP) \-\- Domain names to validate .TP .B Returns List of valid domains .TP .B Return type list .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.display.ops.success_installation(domains: List[str]) -> None Display a box confirming the installation of HTTPS. .INDENT 7.0 .TP .B Parameters \fBdomains\fP (\fIlist\fP) \-\- domain names which were enabled .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.display.ops.success_renewal(unused_domains: List[str]) -> None Display a box confirming the renewal of an existing certificate. .INDENT 7.0 .TP .B Parameters \fBdomains\fP (\fIlist\fP) \-\- domain names which were renewed .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.display.ops.success_revocation(cert_path: str) -> None Display a message confirming a certificate has been revoked. .INDENT 7.0 .TP .B Parameters \fBcert_path\fP (\fIlist\fP) \-\- path to certificate which was revoked. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.display.ops.report_executed_command(command_name: str, returncode: int, stdout: str, stderr: str) -> None Display a message describing the success or failure of an executed process (e.g. hook). .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBcommand_name\fP (\fIstr\fP) \-\- Human\-readable description of the executed command .IP \(bu 2 \fBreturncode\fP (\fIint\fP) \-\- The exit code of the executed command .IP \(bu 2 \fBstdout\fP (\fIstr\fP) \-\- The stdout output of the executed command .IP \(bu 2 \fBstderr\fP (\fIstr\fP) \-\- The stderr output of the executed command .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.display.ops.validated_input(validator: Callable[[str], Any], *args: Any, **kwargs: Any) -> Tuple[str, str] Like \fI\%input_text\fP, but with validation. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBvalidator\fP (\fIcallable\fP) \-\- A method which will be called on the supplied input. If the method raises an \fBerrors.Error\fP, its text will be displayed and the user will be re\-prompted. .IP \(bu 2 \fB*args\fP (\fIlist\fP) \-\- Arguments to be passed to \fI\%input_text\fP\&. .IP \(bu 2 \fB**kwargs\fP (\fIdict\fP) \-\- Arguments to be passed to \fI\%input_text\fP\&. .UNINDENT .TP .B Returns as \fI\%input_text\fP .TP .B Return type tuple .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.display.ops.validated_directory(validator: Callable[[str], Any], *args: Any, **kwargs: Any) -> Tuple[str, str] Like \fI\%directory_select\fP, but with validation. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBvalidator\fP (\fIcallable\fP) \-\- A method which will be called on the supplied input. If the method raises an \fBerrors.Error\fP, its text will be displayed and the user will be re\-prompted. .IP \(bu 2 \fB*args\fP (\fIlist\fP) \-\- Arguments to be passed to \fI\%directory_select\fP\&. .IP \(bu 2 \fB**kwargs\fP (\fIdict\fP) \-\- Arguments to be passed to \fI\%directory_select\fP\&. .UNINDENT .TP .B Returns as \fI\%directory_select\fP .TP .B Return type tuple .UNINDENT .UNINDENT .SS certbot.display.util module .sp Certbot display. .sp This module (\fI\%certbot.display.util\fP) or its companion \fI\%certbot.display.ops\fP should be used whenever: .INDENT 0.0 .IP \(bu 2 Displaying status information to the user on the terminal .IP \(bu 2 Collecting information from the user via prompts .UNINDENT .sp Other messages can use the \fBlogging\fP module. See \fBlog.py\fP\&. .INDENT 0.0 .TP .B certbot.display.util.OK = \(aqok\(aq Display exit code indicating user acceptance. .UNINDENT .INDENT 0.0 .TP .B certbot.display.util.CANCEL = \(aqcancel\(aq Display exit code for a user canceling the display. .UNINDENT .INDENT 0.0 .TP .B certbot.display.util.notify(msg: str) -> None Display a basic status message. .INDENT 7.0 .TP .B Parameters \fBmsg\fP (\fIstr\fP) \-\- message to display .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.display.util.notification(message: str, pause: bool = True, wrap: bool = True, force_interactive: bool = False, decorate: bool = True) -> None Displays a notification and waits for user acceptance. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBmessage\fP (\fIstr\fP) \-\- Message to display .IP \(bu 2 \fBpause\fP (\fIbool\fP) \-\- Whether or not the program should pause for the user\(aqs confirmation .IP \(bu 2 \fBwrap\fP (\fIbool\fP) \-\- Whether or not the application should wrap text .IP \(bu 2 \fBforce_interactive\fP (\fIbool\fP) \-\- True if it\(aqs safe to prompt the user because it won\(aqt cause any workflow regressions .IP \(bu 2 \fBdecorate\fP (\fIbool\fP) \-\- Whether to surround the message with a decorated frame .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.display.util.menu(message: str, choices: List[str] | List[Tuple[str, str]], default: int | None = None, cli_flag: str | None = None, force_interactive: bool = False) -> Tuple[str, int] Display a menu. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBmessage\fP (\fIstr\fP) \-\- title of menu .IP \(bu 2 \fBchoices\fP (\fIlist\fP\fI of \fP\fItuples\fP\fI (\fP\fItag\fP\fI, \fP\fIitem\fP\fI) or \fP\fIlist\fP\fI of \fP\fIdescriptions\fP\fI (\fP\fItags will be enumerated\fP\fI)\fP) \-\- Menu lines, len must be > 0 .IP \(bu 2 \fBdefault\fP \-\- default value to return, if interaction is not possible .IP \(bu 2 \fBcli_flag\fP (\fIstr\fP) \-\- option used to set this value with the CLI .IP \(bu 2 \fBforce_interactive\fP (\fIbool\fP) \-\- True if it\(aqs safe to prompt the user because it won\(aqt cause any workflow regressions .UNINDENT .TP .B Returns tuple of (\fBcode\fP, \fBindex\fP) where \fBcode\fP \- str display exit code \fBindex\fP \- int index of the user\(aqs selection .TP .B Return type tuple .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.display.util.input_text(message: str, default: str | None = None, cli_flag: str | None = None, force_interactive: bool = False) -> Tuple[str, str] Accept input from the user. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBmessage\fP (\fIstr\fP) \-\- message to display to the user .IP \(bu 2 \fBdefault\fP \-\- default value to return, if interaction is not possible .IP \(bu 2 \fBcli_flag\fP (\fIstr\fP) \-\- option used to set this value with the CLI .IP \(bu 2 \fBforce_interactive\fP (\fIbool\fP) \-\- True if it\(aqs safe to prompt the user because it won\(aqt cause any workflow regressions .UNINDENT .TP .B Returns tuple of (\fBcode\fP, \fBinput\fP) where \fBcode\fP \- str display exit code \fBinput\fP \- str of the user\(aqs input .TP .B Return type tuple .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.display.util.yesno(message: str, yes_label: str = \(aqYes\(aq, no_label: str = \(aqNo\(aq, default: bool | None = None, cli_flag: str | None = None, force_interactive: bool = False) -> bool Query the user with a yes/no question. .sp Yes and No label must begin with different letters, and must contain at least one letter each. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBmessage\fP (\fIstr\fP) \-\- question for the user .IP \(bu 2 \fByes_label\fP (\fIstr\fP) \-\- Label of the \(dqYes\(dq parameter .IP \(bu 2 \fBno_label\fP (\fIstr\fP) \-\- Label of the \(dqNo\(dq parameter .IP \(bu 2 \fBdefault\fP \-\- default value to return, if interaction is not possible .IP \(bu 2 \fBcli_flag\fP (\fIstr\fP) \-\- option used to set this value with the CLI .IP \(bu 2 \fBforce_interactive\fP (\fIbool\fP) \-\- True if it\(aqs safe to prompt the user because it won\(aqt cause any workflow regressions .UNINDENT .TP .B Returns True for \(dqYes\(dq, False for \(dqNo\(dq .TP .B Return type bool .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.display.util.checklist(message: str, tags: List[str], default: List[str] | None = None, cli_flag: str | None = None, force_interactive: bool = False) -> Tuple[str, List[str]] Display a checklist. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBmessage\fP (\fIstr\fP) \-\- Message to display to user .IP \(bu 2 \fBtags\fP (\fIlist\fP) \-\- \fBstr\fP tags to select, len(tags) > 0 .IP \(bu 2 \fBdefault\fP \-\- default value to return, if interaction is not possible .IP \(bu 2 \fBcli_flag\fP (\fIstr\fP) \-\- option used to set this value with the CLI .IP \(bu 2 \fBforce_interactive\fP (\fIbool\fP) \-\- True if it\(aqs safe to prompt the user because it won\(aqt cause any workflow regressions .UNINDENT .TP .B Returns tuple of (\fBcode\fP, \fBtags\fP) where \fBcode\fP \- str display exit code \fBtags\fP \- list of selected tags .TP .B Return type tuple .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.display.util.directory_select(message: str, default: str | None = None, cli_flag: str | None = None, force_interactive: bool = False) -> Tuple[str, str] Display a directory selection screen. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBmessage\fP (\fIstr\fP) \-\- prompt to give the user .IP \(bu 2 \fBdefault\fP \-\- default value to return, if interaction is not possible .IP \(bu 2 \fBcli_flag\fP (\fIstr\fP) \-\- option used to set this value with the CLI .IP \(bu 2 \fBforce_interactive\fP (\fIbool\fP) \-\- True if it\(aqs safe to prompt the user because it won\(aqt cause any workflow regressions .UNINDENT .TP .B Returns tuple of the form (\fBcode\fP, \fBstring\fP) where \fBcode\fP \- display exit code \fBstring\fP \- input entered by the user .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.display.util.assert_valid_call(prompt: str, default: str, cli_flag: str, force_interactive: bool) -> None Verify that provided arguments is a valid display call. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBprompt\fP (\fIstr\fP) \-\- prompt for the user .IP \(bu 2 \fBdefault\fP \-\- default answer to prompt .IP \(bu 2 \fBcli_flag\fP (\fIstr\fP) \-\- command line option for setting an answer to this question .IP \(bu 2 \fBforce_interactive\fP (\fIbool\fP) \-\- if interactivity is forced .UNINDENT .UNINDENT .UNINDENT .SS certbot.plugins package .sp Certbot plugins. .SS Submodules .SS certbot.plugins.common module .sp Plugin common functions. .INDENT 0.0 .TP .B certbot.plugins.common.option_namespace(name: str) -> str ArgumentParser options namespace (prefix of all options). .UNINDENT .INDENT 0.0 .TP .B certbot.plugins.common.dest_namespace(name: str) -> str ArgumentParser dest namespace (prefix of all destinations). .UNINDENT .INDENT 0.0 .TP .B class certbot.plugins.common.Plugin(config: NamespaceConfig, name: str) Bases: \fI\%Plugin\fP .sp Generic plugin. .INDENT 7.0 .TP .B abstract classmethod add_parser_arguments(add: Callable[[\&...], None]) -> None Add plugin arguments to the CLI argument parser. .INDENT 7.0 .TP .B Parameters \fBadd\fP (\fIcallable\fP) \-\- Function that proxies calls to \fBargparse.ArgumentParser.add_argument\fP prepending options with unique plugin name prefix. .UNINDENT .UNINDENT .INDENT 7.0 .TP .B classmethod inject_parser_options(parser: ArgumentParser, name: str) -> None Inject parser options. .sp See \fI\%inject_parser_options\fP for docs. .UNINDENT .INDENT 7.0 .TP .B property option_namespace: str ArgumentParser options namespace (prefix of all options). .UNINDENT .INDENT 7.0 .TP .B option_name(name: str) -> str Option name (include plugin namespace). .UNINDENT .INDENT 7.0 .TP .B property dest_namespace: str ArgumentParser dest namespace (prefix of all destinations). .UNINDENT .INDENT 7.0 .TP .B dest(var: str) -> str Find a destination for given variable \fBvar\fP\&. .UNINDENT .INDENT 7.0 .TP .B conf(var: str) -> Any Find a configuration value for variable \fBvar\fP\&. .UNINDENT .INDENT 7.0 .TP .B auth_hint(failed_achalls: List[\fI\%AnnotatedChallenge\fP]) -> str Human\-readable string to help the user troubleshoot the authenticator. .sp Shown to the user if one or more of the attempted challenges were not a success. .sp Should describe, in simple language, what the authenticator tried to do, what went wrong and what the user should try as their \(dqnext steps\(dq. .sp TODO: auth_hint belongs in Authenticator but can\(aqt be added until the next major version of Certbot. For now, it lives in .Plugin and auth_handler will only call it on authenticators that subclass .Plugin. For now, inherit from \fI\%Plugin\fP to implement and/or override the method. .INDENT 7.0 .TP .B Parameters \fBfailed_achalls\fP (\fIlist\fP) \-\- List of one or more failed challenges (\fBachallenges.AnnotatedChallenge\fP subclasses). .TP .B Rtype str .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class certbot.plugins.common.Installer(*args: Any, **kwargs: Any) Bases: \fI\%Installer\fP, \fI\%Plugin\fP .sp An installer base class with reverter and ssl_dhparam methods defined. .sp Installer plugins do not have to inherit from this class. .INDENT 7.0 .TP .B add_to_checkpoint(save_files: Set[str], save_notes: str, temporary: bool = False) -> None Add files to a checkpoint. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBsave_files\fP (\fIset\fP) \-\- set of filepaths to save .IP \(bu 2 \fBsave_notes\fP (\fIstr\fP) \-\- notes about changes during the save .IP \(bu 2 \fBtemporary\fP (\fIbool\fP) \-\- True if the files should be added to a temporary checkpoint rather than a permanent one. This is usually used for changes that will soon be reverted. .UNINDENT .TP .B Raises \fB\&.errors.PluginError\fP \-\- when unable to add to checkpoint .UNINDENT .UNINDENT .INDENT 7.0 .TP .B finalize_checkpoint(title: str) -> None Timestamp and save changes made through the reverter. .INDENT 7.0 .TP .B Parameters \fBtitle\fP (\fIstr\fP) \-\- Title describing checkpoint .TP .B Raises \fB\&.errors.PluginError\fP \-\- when an error occurs .UNINDENT .UNINDENT .INDENT 7.0 .TP .B recovery_routine() -> None Revert all previously modified files. .sp Reverts all modified files that have not been saved as a checkpoint .INDENT 7.0 .TP .B Raises \fB\&.errors.PluginError\fP \-\- If unable to recover the configuration .UNINDENT .UNINDENT .INDENT 7.0 .TP .B revert_temporary_config() -> None Rollback temporary checkpoint. .INDENT 7.0 .TP .B Raises \fB\&.errors.PluginError\fP \-\- when unable to revert config .UNINDENT .UNINDENT .INDENT 7.0 .TP .B rollback_checkpoints(rollback: int = 1) -> None Rollback saved checkpoints. .INDENT 7.0 .TP .B Parameters \fBrollback\fP (\fIint\fP) \-\- Number of checkpoints to revert .TP .B Raises \fB\&.errors.PluginError\fP \-\- If there is a problem with the input or the function is unable to correctly revert the configuration .UNINDENT .UNINDENT .INDENT 7.0 .TP .B property ssl_dhparams: str Full absolute path to ssl_dhparams file. .UNINDENT .INDENT 7.0 .TP .B property updated_ssl_dhparams_digest: str Full absolute path to digest of updated ssl_dhparams file. .UNINDENT .INDENT 7.0 .TP .B install_ssl_dhparams() -> None Copy Certbot\(aqs ssl_dhparams file into the system\(aqs config dir if required. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class certbot.plugins.common.Configurator(*args: Any, **kwargs: Any) Bases: \fI\%Installer\fP, \fI\%Authenticator\fP .sp A plugin that extends certbot.plugins.common.Installer and implements certbot.interfaces.Authenticator .UNINDENT .INDENT 0.0 .TP .B class certbot.plugins.common.Addr(tup: Tuple[str, str], ipv6: bool = False) Bases: \fBobject\fP .sp Represents an virtual host address. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBaddr\fP (\fIstr\fP) \-\- addr part of vhost address .IP \(bu 2 \fBport\fP (\fIstr\fP) \-\- port number or *, or \(dq\(dq .UNINDENT .UNINDENT .INDENT 7.0 .TP .B classmethod fromstring(str_addr: str) -> GenericAddr | None Initialize Addr from string. .UNINDENT .INDENT 7.0 .TP .B normalized_tuple() -> Tuple[str, str] Normalized representation of addr/port tuple .UNINDENT .INDENT 7.0 .TP .B get_addr() -> str Return addr part of Addr object. .UNINDENT .INDENT 7.0 .TP .B get_port() -> str Return port. .UNINDENT .INDENT 7.0 .TP .B get_addr_obj(port: str) -> GenericAddr Return new address object with same addr and new port. .UNINDENT .INDENT 7.0 .TP .B get_ipv6_exploded() -> str Return IPv6 in normalized form .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class certbot.plugins.common.ChallengePerformer(configurator: \fI\%Configurator\fP) Bases: \fBobject\fP .sp Abstract base for challenge performers. .INDENT 7.0 .TP .B Variables .INDENT 7.0 .IP \(bu 2 \fBconfigurator\fP \-\- Authenticator and installer plugin .IP \(bu 2 \fBachalls\fP (\fBlist\fP of \fI\%KeyAuthorizationAnnotatedChallenge\fP) \-\- Annotated challenges .IP \(bu 2 \fBindices\fP (\fBlist\fP of \fBint\fP) \-\- Holds the indices of challenges from a larger array so the user of the class doesn\(aqt have to. .UNINDENT .UNINDENT .INDENT 7.0 .TP .B add_chall(achall: \fI\%KeyAuthorizationAnnotatedChallenge\fP, idx: int | None = None) -> None Store challenge to be performed when perform() is called. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBachall\fP (\fI\&.KeyAuthorizationAnnotatedChallenge\fP) \-\- Annotated challenge. .IP \(bu 2 \fBidx\fP (\fIint\fP) \-\- index to challenge in a larger array .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B perform() -> List[KeyAuthorizationChallengeResponse] Perform all added challenges. .INDENT 7.0 .TP .B Returns challenge responses .TP .B Return type \fBlist\fP of \fBacme.challenges.KeyAuthorizationChallengeResponse\fP .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.plugins.common.install_version_controlled_file(dest_path: str, digest_path: str, src_path: str, all_hashes: Iterable[str]) -> None Copy a file into an active location (likely the system\(aqs config dir) if required. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBdest_path\fP (\fIstr\fP) \-\- destination path for version controlled file .IP \(bu 2 \fBdigest_path\fP (\fIstr\fP) \-\- path to save a digest of the file in .IP \(bu 2 \fBsrc_path\fP (\fIstr\fP) \-\- path to version controlled file found in distribution .IP \(bu 2 \fBall_hashes\fP (\fIlist\fP) \-\- hashes of every released version of the file .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.plugins.common.dir_setup(test_dir: str, pkg: str) -> Tuple[str, str, str] Setup the directories necessary for the configurator. .UNINDENT .SS certbot.plugins.dns_common module .sp Common code for DNS Authenticator Plugins. .INDENT 0.0 .TP .B class certbot.plugins.dns_common.DNSAuthenticator(config: NamespaceConfig, name: str) Bases: \fI\%Plugin\fP, \fI\%Authenticator\fP .sp Base class for DNS Authenticators .INDENT 7.0 .TP .B classmethod add_parser_arguments(add: Callable[[\&...], None], default_propagation_seconds: int = 10) -> None Add plugin arguments to the CLI argument parser. .INDENT 7.0 .TP .B Parameters \fBadd\fP (\fIcallable\fP) \-\- Function that proxies calls to \fBargparse.ArgumentParser.add_argument\fP prepending options with unique plugin name prefix. .UNINDENT .UNINDENT .INDENT 7.0 .TP .B auth_hint(failed_achalls: List[\fI\%AnnotatedChallenge\fP]) -> str See certbot.plugins.common.Plugin.auth_hint. .UNINDENT .INDENT 7.0 .TP .B get_chall_pref(unused_domain: str) -> Iterable[Type[Challenge]] Return \fBcollections.Iterable\fP of challenge preferences. .INDENT 7.0 .TP .B Parameters \fBdomain\fP (\fIstr\fP) \-\- Domain for which challenge preferences are sought. .TP .B Returns \fBcollections.Iterable\fP of challenge types (subclasses of \fBacme.challenges.Challenge\fP) with the most preferred challenges first. If a type is not specified, it means the Authenticator cannot perform the challenge. .TP .B Return type \fBcollections.Iterable\fP .UNINDENT .UNINDENT .INDENT 7.0 .TP .B prepare() -> None Prepare the plugin. .sp Finish up any additional initialization. .INDENT 7.0 .TP .B Raises .INDENT 7.0 .IP \(bu 2 \fB\&.PluginError\fP \-\- when full initialization cannot be completed. .IP \(bu 2 \fB\&.MisconfigurationError\fP \-\- when full initialization cannot be completed. Plugin will be displayed on a list of available plugins. .IP \(bu 2 \fB\&.NoInstallationError\fP \-\- when the necessary programs/files cannot be located. Plugin will NOT be displayed on a list of available plugins. .IP \(bu 2 \fB\&.NotSupportedError\fP \-\- when the installation is recognized, but the version is not currently supported. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B more_info() -> str Human\-readable string to help the user. .sp Should describe the steps taken and any relevant info to help the user decide which plugin to use. .INDENT 7.0 .TP .B Rtype str .UNINDENT .UNINDENT .INDENT 7.0 .TP .B perform(achalls: List[\fI\%AnnotatedChallenge\fP]) -> List[ChallengeResponse] Perform the given challenge. .INDENT 7.0 .TP .B Parameters \fBachalls\fP (\fIlist\fP) \-\- Non\-empty (guaranteed) list of \fI\%AnnotatedChallenge\fP instances, such that it contains types found within \fI\%get_chall_pref()\fP only. .TP .B Returns list of ACME \fBChallengeResponse\fP instances corresponding to each provided \fBChallenge\fP\&. .TP .B Return type \fBcollections.List\fP of \fBacme.challenges.ChallengeResponse\fP, where responses are required to be returned in the same order as corresponding input challenges .TP .B Raises \fB\&.PluginError\fP \-\- If some or all challenges cannot be performed .UNINDENT .UNINDENT .INDENT 7.0 .TP .B cleanup(achalls: List[\fI\%AnnotatedChallenge\fP]) -> None Revert changes and shutdown after challenges complete. .sp This method should be able to revert all changes made by perform, even if perform exited abnormally. .INDENT 7.0 .TP .B Parameters \fBachalls\fP (\fIlist\fP) \-\- Non\-empty (guaranteed) list of \fI\%AnnotatedChallenge\fP instances, a subset of those previously passed to \fI\%perform()\fP\&. .TP .B Raises \fI\%PluginError\fP \-\- if original configuration cannot be restored .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class certbot.plugins.dns_common.CredentialsConfiguration(filename: str, mapper: ~typing.Callable[[str], str] = >) Bases: \fBobject\fP .sp Represents a user\-supplied filed which stores API credentials. .INDENT 7.0 .TP .B require(required_variables: Mapping[str, str]) -> None Ensures that the supplied set of variables are all present in the file. .INDENT 7.0 .TP .B Parameters \fBrequired_variables\fP (\fIdict\fP) \-\- Map of variable which must be present to error to display. .TP .B Raises \fI\%errors.PluginError\fP \-\- If one or more are missing. .UNINDENT .UNINDENT .INDENT 7.0 .TP .B conf(var: str) -> str | None Find a configuration value for variable \fBvar\fP, as transformed by \fBmapper\fP\&. .INDENT 7.0 .TP .B Parameters \fBvar\fP (\fIstr\fP) \-\- The variable to get. .TP .B Returns The value of the variable, if it exists. .TP .B Return type str or None .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.plugins.dns_common.validate_file(filename: str) -> None Ensure that the specified file exists. .UNINDENT .INDENT 0.0 .TP .B certbot.plugins.dns_common.validate_file_permissions(filename: str) -> None Ensure that the specified file exists and warn about unsafe permissions. .UNINDENT .INDENT 0.0 .TP .B certbot.plugins.dns_common.base_domain_name_guesses(domain: str) -> List[str] Return a list of progressively less\-specific domain names. .sp One of these will probably be the domain name known to the DNS provider. .INDENT 7.0 .TP .B Example .UNINDENT .sp .EX >>> base_domain_name_guesses(\(aqfoo.bar.baz.example.com\(aq) [\(aqfoo.bar.baz.example.com\(aq, \(aqbar.baz.example.com\(aq, \(aqbaz.example.com\(aq, \(aqexample.com\(aq, \(aqcom\(aq] .EE .INDENT 7.0 .TP .B Parameters \fBdomain\fP (\fIstr\fP) \-\- The domain for which to return guesses. .TP .B Returns The a list of less specific domain names. .TP .B Return type list .UNINDENT .UNINDENT .SS certbot.plugins.dns_common_lexicon module .sp Internal class delegating to a module, and displaying warnings when attributes related to deprecated attributes in the current module. .INDENT 0.0 .TP .B class certbot.plugins.dns_common_lexicon.LexiconClient Bases: \fBobject\fP .sp Encapsulates all communication with a DNS provider via Lexicon. .sp Deprecated since version 2.7.0: Please use certbot.plugins.dns_common_lexicon.LexiconDNSAuthenticator instead. .INDENT 7.0 .TP .B add_txt_record(domain: str, record_name: str, record_content: str) -> None Add a TXT record using the supplied information. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBdomain\fP (\fIstr\fP) \-\- The domain to use to look up the managed zone. .IP \(bu 2 \fBrecord_name\fP (\fIstr\fP) \-\- The record name (typically beginning with \(aq_acme\-challenge.\(aq). .IP \(bu 2 \fBrecord_content\fP (\fIstr\fP) \-\- The record content (typically the challenge validation). .UNINDENT .TP .B Raises \fI\%errors.PluginError\fP \-\- if an error occurs communicating with the DNS Provider API .UNINDENT .UNINDENT .INDENT 7.0 .TP .B del_txt_record(domain: str, record_name: str, record_content: str) -> None Delete a TXT record using the supplied information. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBdomain\fP (\fIstr\fP) \-\- The domain to use to look up the managed zone. .IP \(bu 2 \fBrecord_name\fP (\fIstr\fP) \-\- The record name (typically beginning with \(aq_acme\-challenge.\(aq). .IP \(bu 2 \fBrecord_content\fP (\fIstr\fP) \-\- The record content (typically the challenge validation). .UNINDENT .TP .B Raises \fI\%errors.PluginError\fP \-\- if an error occurs communicating with the DNS Provider API .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.plugins.dns_common_lexicon.build_lexicon_config(lexicon_provider_name: str, lexicon_options: Mapping[str, Any], provider_options: Mapping[str, Any]) -> None | Dict[str, Any] Convenient function to build a Lexicon 2.x/3.x config object. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBlexicon_provider_name\fP (\fIstr\fP) \-\- the name of the lexicon provider to use .IP \(bu 2 \fBlexicon_options\fP (\fIdict\fP) \-\- options specific to lexicon .IP \(bu 2 \fBprovider_options\fP (\fIdict\fP) \-\- options specific to provider .UNINDENT .TP .B Returns configuration to apply to the provider .TP .B Return type ConfigurationResolver or dict .UNINDENT .sp Deprecated since version 2.7.0: Please use certbot.plugins.dns_common_lexicon.LexiconDNSAuthenticator instead. .UNINDENT .INDENT 0.0 .TP .B class certbot.plugins.dns_common_lexicon.LexiconDNSAuthenticator(config: NamespaceConfig, name: str) Bases: \fI\%DNSAuthenticator\fP .sp Base class for a DNS authenticator that uses Lexicon client as backend to execute DNS record updates .UNINDENT .SS certbot.plugins.dns_test_common module .sp Base test class for DNS authenticators. .INDENT 0.0 .TP .B class certbot.plugins.dns_test_common.BaseAuthenticatorTest Bases: \fBobject\fP .sp A base test class to reduce duplication between test code for DNS Authenticator Plugins. .INDENT 7.0 .TP .B Assumes: .INDENT 7.0 .IP \(bu 2 That subclasses also subclass unittest.TestCase .IP \(bu 2 That the authenticator is stored as self.auth .UNINDENT .UNINDENT .INDENT 7.0 .TP .B achall = KeyAuthorizationAnnotatedChallenge(challb=DNS01(token=b\(aq17817c66b60ce2e4012dfad92657527a\(aq), domain=\(aqexample.com\(aq, account_key=JWKRSA(key=)>)) .UNINDENT .INDENT 7.0 .TP .B test_more_info() -> None .UNINDENT .INDENT 7.0 .TP .B test_get_chall_pref() -> None .UNINDENT .INDENT 7.0 .TP .B test_parser_arguments() -> None .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.plugins.dns_test_common.write(values: Mapping[str, Any], path: str) -> None Write the specified values to a config file. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBvalues\fP (\fIdict\fP) \-\- A map of values to write. .IP \(bu 2 \fBpath\fP (\fIstr\fP) \-\- Where to write the values. .UNINDENT .UNINDENT .UNINDENT .SS certbot.plugins.dns_test_common_lexicon module .sp Internal class delegating to a module, and displaying warnings when attributes related to deprecated attributes in the current module. .INDENT 0.0 .TP .B class certbot.plugins.dns_test_common_lexicon.BaseLexiconAuthenticatorTest Bases: \fI\%BaseAuthenticatorTest\fP .INDENT 7.0 .TP .B test_perform(unused_mock_get_utility: Any) -> None .UNINDENT .INDENT 7.0 .TP .B test_cleanup() -> None .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class certbot.plugins.dns_test_common_lexicon.BaseLexiconClientTest Bases: \fBobject\fP .INDENT 7.0 .TP .B DOMAIN_NOT_FOUND = Exception(\(aqNo domain found\(aq) .UNINDENT .INDENT 7.0 .TP .B GENERIC_ERROR alias of \fBRequestException\fP .UNINDENT .INDENT 7.0 .TP .B LOGIN_ERROR = HTTPError(\(aq400 Client Error: ...\(aq) .UNINDENT .INDENT 7.0 .TP .B UNKNOWN_LOGIN_ERROR = HTTPError(\(aq500 Surprise! Error: ...\(aq) .UNINDENT .INDENT 7.0 .TP .B record_prefix = \(aq_acme\-challenge\(aq .UNINDENT .INDENT 7.0 .TP .B record_name = \(aq_acme\-challenge.example.com\(aq .UNINDENT .INDENT 7.0 .TP .B record_content = \(aqbar\(aq .UNINDENT .INDENT 7.0 .TP .B test_add_txt_record() -> None .UNINDENT .INDENT 7.0 .TP .B test_add_txt_record_try_twice_to_find_domain() -> None .UNINDENT .INDENT 7.0 .TP .B test_add_txt_record_fail_to_find_domain() -> None .UNINDENT .INDENT 7.0 .TP .B test_add_txt_record_fail_to_authenticate() -> None .UNINDENT .INDENT 7.0 .TP .B test_add_txt_record_fail_to_authenticate_with_unknown_error() -> None .UNINDENT .INDENT 7.0 .TP .B test_add_txt_record_error_finding_domain() -> None .UNINDENT .INDENT 7.0 .TP .B test_add_txt_record_error_adding_record() -> None .UNINDENT .INDENT 7.0 .TP .B test_del_txt_record() -> None .UNINDENT .INDENT 7.0 .TP .B test_del_txt_record_fail_to_find_domain() -> None .UNINDENT .INDENT 7.0 .TP .B test_del_txt_record_fail_to_authenticate() -> None .UNINDENT .INDENT 7.0 .TP .B test_del_txt_record_fail_to_authenticate_with_unknown_error() -> None .UNINDENT .INDENT 7.0 .TP .B test_del_txt_record_error_finding_domain() -> None .UNINDENT .INDENT 7.0 .TP .B test_del_txt_record_error_deleting_record() -> None .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class certbot.plugins.dns_test_common_lexicon.BaseLexiconDNSAuthenticatorTest Bases: \fI\%BaseAuthenticatorTest\fP .INDENT 7.0 .TP .B DOMAIN_NOT_FOUND = Exception(\(aqNo domain found\(aq) .UNINDENT .INDENT 7.0 .TP .B GENERIC_ERROR alias of \fBRequestException\fP .UNINDENT .INDENT 7.0 .TP .B LOGIN_ERROR = HTTPError(\(aq400 Client Error: ...\(aq) .UNINDENT .INDENT 7.0 .TP .B UNKNOWN_LOGIN_ERROR = HTTPError(\(aq500 Surprise! Error: ...\(aq) .UNINDENT .INDENT 7.0 .TP .B test_perform_succeed() -> None .UNINDENT .INDENT 7.0 .TP .B test_perform_with_one_domain_resolution_failure_succeed() -> None .UNINDENT .INDENT 7.0 .TP .B test_perform_with_two_domain_resolution_failures_raise() -> None .UNINDENT .INDENT 7.0 .TP .B test_perform_with_domain_resolution_general_failure_raise() -> None .UNINDENT .INDENT 7.0 .TP .B test_perform_with_auth_failure_raise() -> None .UNINDENT .INDENT 7.0 .TP .B test_perform_with_unknown_auth_failure_raise() -> None .UNINDENT .INDENT 7.0 .TP .B test_perform_with_create_record_failure_raise() -> None .UNINDENT .INDENT 7.0 .TP .B test_cleanup_success() -> None .UNINDENT .INDENT 7.0 .TP .B test_cleanup_with_auth_failure_ignore() -> None .UNINDENT .INDENT 7.0 .TP .B test_cleanup_with_unknown_auth_failure_ignore() -> None .UNINDENT .INDENT 7.0 .TP .B test_cleanup_with_domain_resolution_failure_ignore() -> None .UNINDENT .INDENT 7.0 .TP .B test_cleanup_with_domain_resolution_general_failure_ignore() -> None .UNINDENT .INDENT 7.0 .TP .B test_cleanup_with_delete_record_failure_ignore() -> None .UNINDENT .UNINDENT .SS certbot.plugins.enhancements module .sp New interface style Certbot enhancements .INDENT 0.0 .TP .B certbot.plugins.enhancements.ENHANCEMENTS = [\(aqredirect\(aq, \(aqensure\-http\-header\(aq, \(aqocsp\-stapling\(aq] List of possible \fI\%certbot.interfaces.Installer\fP enhancements. .sp List of expected options parameters: \- redirect: None \- ensure\-http\-header: name of header (i.e. Strict\-Transport\-Security) \- ocsp\-stapling: certificate chain file path .UNINDENT .INDENT 0.0 .TP .B certbot.plugins.enhancements.enabled_enhancements(config: NamespaceConfig) -> Generator[Dict[str, Any], None, None] Generator to yield the enabled new style enhancements. .INDENT 7.0 .TP .B Parameters \fBconfig\fP (\fIcertbot.configuration.NamespaceConfig\fP) \-\- Configuration. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.plugins.enhancements.are_requested(config: NamespaceConfig) -> bool Checks if one or more of the requested enhancements are those of the new enhancement interfaces. .INDENT 7.0 .TP .B Parameters \fBconfig\fP (\fIcertbot.configuration.NamespaceConfig\fP) \-\- Configuration. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.plugins.enhancements.are_supported(config: NamespaceConfig, installer: \fI\%Installer\fP | None) -> bool Checks that all of the requested enhancements are supported by the installer. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBconfig\fP (\fIcertbot.configuration.NamespaceConfig\fP) \-\- Configuration. .IP \(bu 2 \fBinstaller\fP (\fI\%interfaces.Installer\fP) \-\- Installer object .UNINDENT .TP .B Returns If all the requested enhancements are supported by the installer .TP .B Return type bool .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.plugins.enhancements.enable(lineage: \fI\%RenewableCert\fP | None, domains: Iterable[str], installer: \fI\%Installer\fP | None, config: NamespaceConfig) -> None Run enable method for each requested enhancement that is supported. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBlineage\fP (\fI\%certbot.interfaces.RenewableCert\fP) \-\- Certificate lineage object .IP \(bu 2 \fBdomains\fP (\fIstr\fP) \-\- List of domains in certificate to enhance .IP \(bu 2 \fBinstaller\fP (\fI\%interfaces.Installer\fP) \-\- Installer object .IP \(bu 2 \fBconfig\fP (\fIcertbot.configuration.NamespaceConfig\fP) \-\- Configuration. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.plugins.enhancements.populate_cli(add: Callable[[\&...], None]) -> None Populates the command line flags for certbot._internal.cli.HelpfulParser .INDENT 7.0 .TP .B Parameters \fBadd\fP (\fIfunc\fP) \-\- Add function of certbot._internal.cli.HelpfulParser .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class certbot.plugins.enhancements.AutoHSTSEnhancement Bases: \fBobject\fP .sp Enhancement interface that installer plugins can implement in order to provide functionality that configures the software to have a \(aqStrict\-Transport\-Security\(aq with initially low max\-age value that will increase over time. .sp The plugins implementing new style enhancements are responsible of handling the saving of configuration checkpoints as well as calling possible restarts of managed software themselves. For update_autohsts method, the installer may have to call prepare() to finalize the plugin initialization. .INDENT 7.0 .TP .B Methods: enable_autohsts is called when the header is initially installed using a low max\-age value. .sp update_autohsts is called every time when Certbot is run using \(aqrenew\(aq verb. The max\-age value should be increased over time using this method. .sp deploy_autohsts is called for every lineage that has had its certificate renewed. A long HSTS max\-age value should be set here, as we should be confident that the user is able to automatically renew their certificates. .UNINDENT .INDENT 7.0 .TP .B abstract update_autohsts(lineage: \fI\%RenewableCert\fP, *args: Any, **kwargs: Any) -> None Gets called for each lineage every time Certbot is run with \(aqrenew\(aq verb. Implementation of this method should increase the max\-age value. .INDENT 7.0 .TP .B Parameters \fBlineage\fP (\fI\%certbot.interfaces.RenewableCert\fP) \-\- Certificate lineage object .UNINDENT .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 prepare() method inherited from \fBinterfaces.Plugin\fP might need to be called manually within implementation of this interface method to finalize the plugin initialization. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B abstract deploy_autohsts(lineage: \fI\%RenewableCert\fP, *args: Any, **kwargs: Any) -> None Gets called for a lineage when its certificate is successfully renewed. Long max\-age value should be set in implementation of this method. .INDENT 7.0 .TP .B Parameters \fBlineage\fP (\fI\%certbot.interfaces.RenewableCert\fP) \-\- Certificate lineage object .UNINDENT .UNINDENT .INDENT 7.0 .TP .B abstract enable_autohsts(lineage: \fI\%RenewableCert\fP | None, domains: Iterable[str], *args: Any, **kwargs: Any) -> None Enables the AutoHSTS enhancement, installing Strict\-Transport\-Security header with a low initial value to be increased over the subsequent runs of Certbot renew. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBlineage\fP (\fI\%certbot.interfaces.RenewableCert\fP) \-\- Certificate lineage object .IP \(bu 2 \fBdomains\fP (\fBlist\fP of \fBstr\fP) \-\- List of domains in certificate to enhance .UNINDENT .UNINDENT .UNINDENT .UNINDENT .SS certbot.plugins.storage module .sp Plugin storage class. .INDENT 0.0 .TP .B class certbot.plugins.storage.PluginStorage(config: NamespaceConfig, classkey: str) Bases: \fBobject\fP .sp Class implementing storage functionality for plugins .INDENT 7.0 .TP .B save() -> None Saves PluginStorage content to disk .INDENT 7.0 .TP .B Raises \fB\&.errors.PluginStorageError\fP \-\- when unable to serialize the data or write it to the filesystem .UNINDENT .UNINDENT .INDENT 7.0 .TP .B put(key: str, value: Any) -> None Put configuration value to PluginStorage .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBkey\fP (\fIstr\fP) \-\- Key to store the value to .IP \(bu 2 \fBvalue\fP \-\- Data to store .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B fetch(key: str) -> Any Get configuration value from PluginStorage .INDENT 7.0 .TP .B Parameters \fBkey\fP (\fIstr\fP) \-\- Key to get value from the storage .TP .B Raises \fBKeyError\fP \-\- If the key doesn\(aqt exist in the storage .UNINDENT .UNINDENT .UNINDENT .SS certbot.plugins.util module .sp Plugin utilities. .INDENT 0.0 .TP .B certbot.plugins.util.get_prefixes(path: str) -> List[str] Retrieves all possible path prefixes of a path, in descending order of length. For instance: .INDENT 7.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 (Linux) \fB/a/b/c\fP returns \fB[\(aq/a/b/c\(aq, \(aq/a/b\(aq, \(aq/a\(aq, \(aq/\(aq]\fP .IP \(bu 2 (Windows) \fBC:abc\fP returns \fB[\(aqC:abc\(aq, \(aqC:ab\(aq, \(aqC:a\(aq, \(aqC:\(aq]\fP .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B Parameters \fBpath\fP (\fIstr\fP) \-\- the path to break into prefixes .TP .B Returns all possible path prefixes of given path in descending order .TP .B Return type \fBlist\fP of \fBstr\fP .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.plugins.util.path_surgery(cmd: str) -> bool Attempt to perform PATH surgery to find cmd .sp Mitigates \fI\%https://github.com/certbot/certbot/issues/1833\fP .INDENT 7.0 .TP .B Parameters \fBcmd\fP (\fIstr\fP) \-\- the command that is being searched for in the PATH .TP .B Returns True if the operation succeeded, False otherwise .UNINDENT .UNINDENT .SS certbot.tests package .sp Utilities for running Certbot tests .SS Submodules .SS certbot.tests.acme_util module .sp ACME utilities for testing. .INDENT 0.0 .TP .B certbot.tests.acme_util.chall_to_challb(chall: Challenge, status: Status) -> ChallengeBody Return ChallengeBody from Challenge. .UNINDENT .INDENT 0.0 .TP .B certbot.tests.acme_util.gen_authzr(authz_status: Status, domain: str, challs: Iterable[Challenge], statuses: Iterable[Status]) -> AuthorizationResource Generate an authorization resource. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBauthz_status\fP (\fBacme.messages.Status\fP) \-\- Status object .IP \(bu 2 \fBchalls\fP (\fIlist\fP) \-\- Challenge objects .IP \(bu 2 \fBstatuses\fP (\fIlist\fP) \-\- status of each challenge object .UNINDENT .UNINDENT .UNINDENT .SS certbot.tests.util module .sp Test utilities. .INDENT 0.0 .TP .B class certbot.tests.util.DummyInstaller(*args: Any, **kwargs: Any) Bases: \fI\%Installer\fP .sp Dummy installer plugin for test purpose. .INDENT 7.0 .TP .B get_all_names() -> Iterable[str] Returns all names that may be authenticated. .INDENT 7.0 .TP .B Return type \fBcollections.Iterable\fP of \fBstr\fP .UNINDENT .UNINDENT .INDENT 7.0 .TP .B deploy_cert(domain: str, cert_path: str, key_path: str, chain_path: str, fullchain_path: str) -> None Deploy certificate. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBdomain\fP (\fIstr\fP) \-\- domain to deploy certificate file .IP \(bu 2 \fBcert_path\fP (\fIstr\fP) \-\- absolute path to the certificate file .IP \(bu 2 \fBkey_path\fP (\fIstr\fP) \-\- absolute path to the private key file .IP \(bu 2 \fBchain_path\fP (\fIstr\fP) \-\- absolute path to the certificate chain file .IP \(bu 2 \fBfullchain_path\fP (\fIstr\fP) \-\- absolute path to the certificate fullchain file (cert plus chain) .UNINDENT .TP .B Raises \fB\&.PluginError\fP \-\- when cert cannot be deployed .UNINDENT .UNINDENT .INDENT 7.0 .TP .B enhance(domain: str, enhancement: str, options: List[str] | str | None = None) -> None Perform a configuration enhancement. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBdomain\fP (\fIstr\fP) \-\- domain for which to provide enhancement .IP \(bu 2 \fBenhancement\fP (\fIstr\fP) \-\- An enhancement as defined in \fI\%ENHANCEMENTS\fP .IP \(bu 2 \fBoptions\fP \-\- Flexible options parameter for enhancement. Check documentation of \fI\%ENHANCEMENTS\fP for expected options for each enhancement. .UNINDENT .TP .B Raises \fB\&.PluginError\fP \-\- If Enhancement is not supported, or if an error occurs during the enhancement. .UNINDENT .UNINDENT .INDENT 7.0 .TP .B supported_enhancements() -> List[str] Returns a \fBcollections.Iterable\fP of supported enhancements. .INDENT 7.0 .TP .B Returns supported enhancements which should be a subset of \fI\%ENHANCEMENTS\fP .TP .B Return type \fBcollections.Iterable\fP of \fBstr\fP .UNINDENT .UNINDENT .INDENT 7.0 .TP .B save(title: str | None = None, temporary: bool = False) -> None Saves all changes to the configuration files. .sp Both title and temporary are needed because a save may be intended to be permanent, but the save is not ready to be a full checkpoint. .sp It is assumed that at most one checkpoint is finalized by this method. Additionally, if an exception is raised, it is assumed a new checkpoint was not finalized. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBtitle\fP (\fIstr\fP) \-\- The title of the save. If a title is given, the configuration will be saved as a new checkpoint and put in a timestamped directory. \fBtitle\fP has no effect if temporary is true. .IP \(bu 2 \fBtemporary\fP (\fIbool\fP) \-\- Indicates whether the changes made will be quickly reversed in the future (challenges) .UNINDENT .TP .B Raises \fB\&.PluginError\fP \-\- when save is unsuccessful .UNINDENT .UNINDENT .INDENT 7.0 .TP .B config_test() -> None Make sure the configuration is valid. .INDENT 7.0 .TP .B Raises \fB\&.MisconfigurationError\fP \-\- when the config is not in a usable state .UNINDENT .UNINDENT .INDENT 7.0 .TP .B restart() -> None Restart or refresh the server content. .INDENT 7.0 .TP .B Raises \fB\&.PluginError\fP \-\- when server cannot be restarted .UNINDENT .UNINDENT .INDENT 7.0 .TP .B classmethod add_parser_arguments(add: Callable[[\&...], None]) -> None Add plugin arguments to the CLI argument parser. .INDENT 7.0 .TP .B Parameters \fBadd\fP (\fIcallable\fP) \-\- Function that proxies calls to \fBargparse.ArgumentParser.add_argument\fP prepending options with unique plugin name prefix. .UNINDENT .UNINDENT .INDENT 7.0 .TP .B prepare() -> None Prepare the plugin. .sp Finish up any additional initialization. .INDENT 7.0 .TP .B Raises .INDENT 7.0 .IP \(bu 2 \fB\&.PluginError\fP \-\- when full initialization cannot be completed. .IP \(bu 2 \fB\&.MisconfigurationError\fP \-\- when full initialization cannot be completed. Plugin will be displayed on a list of available plugins. .IP \(bu 2 \fB\&.NoInstallationError\fP \-\- when the necessary programs/files cannot be located. Plugin will NOT be displayed on a list of available plugins. .IP \(bu 2 \fB\&.NotSupportedError\fP \-\- when the installation is recognized, but the version is not currently supported. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B more_info() -> str Human\-readable string to help the user. .sp Should describe the steps taken and any relevant info to help the user decide which plugin to use. .INDENT 7.0 .TP .B Rtype str .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.tests.util.vector_path(*names: str) -> str Path to a test vector. .UNINDENT .INDENT 0.0 .TP .B certbot.tests.util.load_vector(*names: str) -> bytes Load contents of a test vector. .UNINDENT .INDENT 0.0 .TP .B certbot.tests.util.load_cert(*names: str) -> X509 Load certificate. .UNINDENT .INDENT 0.0 .TP .B certbot.tests.util.load_csr(*names: str) -> X509Req Load certificate request. .UNINDENT .INDENT 0.0 .TP .B certbot.tests.util.load_comparable_csr(*names: str) -> ComparableX509 Load ComparableX509 certificate request. .UNINDENT .INDENT 0.0 .TP .B certbot.tests.util.load_rsa_private_key(*names: str) -> ComparableRSAKey Load RSA private key. .UNINDENT .INDENT 0.0 .TP .B certbot.tests.util.load_pyopenssl_private_key(*names: str) -> PKey Load pyOpenSSL private key. .UNINDENT .INDENT 0.0 .TP .B certbot.tests.util.make_lineage(config_dir: str, testfile: str, ec: bool = True) -> str Creates a lineage defined by testfile. .sp This creates the archive, live, and renewal directories if necessary and creates a simple lineage. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBconfig_dir\fP (\fIstr\fP) \-\- path to the configuration directory .IP \(bu 2 \fBtestfile\fP (\fIstr\fP) \-\- configuration file to base the lineage on .IP \(bu 2 \fBec\fP (\fIbool\fP) \-\- True if we generate the lineage with an ECDSA key .UNINDENT .TP .B Returns path to the renewal conf file for the created lineage .TP .B Return type str .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.tests.util.patch_display_util() -> MagicMock Patch certbot.display.util to use a special mock display utility. .sp The mock display utility works like a regular mock object, except it also also asserts that methods are called with valid arguments. .sp The mock created by this patch mocks out Certbot internals. That is, the mock object will be called by the certbot.display.util functions and the mock returned by that call will be used as the display utility. This was done to simplify the transition from zope.component and mocking certbot.display.util functions directly in test code should be preferred over using this function in the future. .sp See \fI\%https://github.com/certbot/certbot/issues/8948\fP .INDENT 7.0 .TP .B Returns patch on the function used internally by certbot.display.util to get a display utility instance .TP .B Return type mock.MagicMock .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.tests.util.patch_display_util_with_stdout(stdout: IO | None = None) -> MagicMock Patch certbot.display.util to use a special mock display utility. .sp The mock display utility works like a regular mock object, except it also asserts that methods are called with valid arguments. .sp The mock created by this patch mocks out Certbot internals. That is, the mock object will be called by the certbot.display.util functions and the mock returned by that call will be used as the display utility. This was done to simplify the transition from zope.component and mocking certbot.display.util functions directly in test code should be preferred over using this function in the future. .sp See \fI\%https://github.com/certbot/certbot/issues/8948\fP .sp The \fBmessage\fP argument passed to the display utility methods is passed to stdout\(aqs write method. .INDENT 7.0 .TP .B Parameters \fBstdout\fP (\fIobject\fP) \-\- object to write standard output to; it is expected to have a \fBwrite\fP method .TP .B Returns patch on the function used internally by certbot.display.util to get a display utility instance .TP .B Return type mock.MagicMock .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class certbot.tests.util.FreezableMock(frozen: bool = False, func: Callable[[\&...], Any] | None = None, return_value: Any = sentinel.DEFAULT) Bases: \fBobject\fP .sp Mock object with the ability to freeze attributes. .sp This class works like a regular mock.MagicMock object, except attributes and behavior set before the object is frozen cannot be changed during tests. .sp If a func argument is provided to the constructor, this function is called first when an instance of FreezableMock is called, followed by the usual behavior defined by MagicMock. The return value of func is ignored. .INDENT 7.0 .TP .B freeze() -> None Freeze object preventing further changes. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class certbot.tests.util.TempDirTestCase(methodName=\(aqrunTest\(aq) Bases: \fBTestCase\fP .sp Base test class which sets up and tears down a temporary directory .INDENT 7.0 .TP .B setUp() -> None Execute before test .UNINDENT .INDENT 7.0 .TP .B tearDown() -> None Execute after test .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class certbot.tests.util.ConfigTestCase(methodName=\(aqrunTest\(aq) Bases: \fI\%TempDirTestCase\fP .sp Test class which sets up a NamespaceConfig object. .INDENT 7.0 .TP .B setUp() -> None Execute before test .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.tests.util.lock_and_call(callback: Callable[[], Any], path_to_lock: str) -> None Grab a lock on path_to_lock from a foreign process then execute the callback. :param callable callback: object to call after acquiring the lock :param str path_to_lock: path to file or directory to lock .UNINDENT .INDENT 0.0 .TP .B certbot.tests.util.skip_on_windows(reason: str) -> Callable[[Callable[[\&...], Any]], Callable[[\&...], Any]] Decorator to skip permanently a test on Windows. A reason is required. .UNINDENT .INDENT 0.0 .TP .B certbot.tests.util.temp_join(path: str) -> str Return the given path joined to the tempdir path for the current platform Eg.: \(aqcert\(aq => /tmp/cert (Linux) or \(aqC:UserscurrentuserAppDataTempcert\(aq (Windows) .UNINDENT .SS Submodules .SS certbot.achallenges module .sp Client annotated ACME challenges. .sp Please use names such as \fBachall\fP to distinguish from variables \(dqof type\(dq \fBacme.challenges.Challenge\fP (denoted by \fBchall\fP) and \fBChallengeBody\fP (denoted by \fBchallb\fP): .INDENT 0.0 .INDENT 3.5 .sp .EX from acme import challenges from acme import messages from certbot import achallenges chall = challenges.DNS(token=\(aqfoo\(aq) challb = messages.ChallengeBody(chall=chall) achall = achallenges.DNS(chall=challb, domain=\(aqexample.com\(aq) .EE .UNINDENT .UNINDENT .sp Note, that all annotated challenges act as a proxy objects: .INDENT 0.0 .INDENT 3.5 .sp .EX achall.token == challb.token .EE .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class certbot.achallenges.AnnotatedChallenge(**kwargs: Any) Bases: \fBImmutableMap\fP .sp Client annotated challenge. .sp Wraps around server provided challenge and annotates with data useful for the client. .INDENT 7.0 .TP .B Variables \fB~.challb\fP \-\- Wrapped \fBChallengeBody\fP\&. .UNINDENT .INDENT 7.0 .TP .B challb .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class certbot.achallenges.KeyAuthorizationAnnotatedChallenge(**kwargs: Any) Bases: \fI\%AnnotatedChallenge\fP .sp Client annotated \fBKeyAuthorizationChallenge\fP challenge. .INDENT 7.0 .TP .B response_and_validation(*args: Any, **kwargs: Any) -> Any Generate response and validation. .UNINDENT .INDENT 7.0 .TP .B challb .UNINDENT .INDENT 7.0 .TP .B domain .UNINDENT .INDENT 7.0 .TP .B account_key .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class certbot.achallenges.DNS(**kwargs: Any) Bases: \fI\%AnnotatedChallenge\fP .sp Client annotated \(dqdns\(dq ACME challenge. .INDENT 7.0 .TP .B acme_type alias of \fBDNS\fP .UNINDENT .INDENT 7.0 .TP .B challb .UNINDENT .INDENT 7.0 .TP .B domain .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class certbot.achallenges.Other(**kwargs: Any) Bases: \fI\%AnnotatedChallenge\fP .sp Client annotated ACME challenge of an unknown type. .INDENT 7.0 .TP .B acme_type alias of \fBChallenge\fP .UNINDENT .INDENT 7.0 .TP .B challb .UNINDENT .INDENT 7.0 .TP .B domain .UNINDENT .UNINDENT .SS certbot.crypto_util module .sp Certbot client crypto utility functions. .INDENT 0.0 .TP .B certbot.crypto_util.generate_key(key_size: int, key_dir: str | None, key_type: str = \(aqrsa\(aq, elliptic_curve: str = \(aqsecp256r1\(aq, keyname: str = \(aqkey\-certbot.pem\(aq, strict_permissions: bool = True) -> \fI\%Key\fP Initializes and saves a privkey. .sp Inits key and saves it in PEM format on the filesystem. .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 keyname is the attempted filename, it may be different if a file already exists at the path. .UNINDENT .UNINDENT .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBkey_size\fP (\fIint\fP) \-\- key size in bits if key size is rsa. .IP \(bu 2 \fBkey_dir\fP (\fIstr\fP) \-\- Optional key save directory. .IP \(bu 2 \fBkey_type\fP (\fIstr\fP) \-\- Key Type [rsa, ecdsa] .IP \(bu 2 \fBelliptic_curve\fP (\fIstr\fP) \-\- Name of the elliptic curve if key type is ecdsa. .IP \(bu 2 \fBkeyname\fP (\fIstr\fP) \-\- Filename of key .IP \(bu 2 \fBstrict_permissions\fP (\fIbool\fP) \-\- If true and key_dir exists, an exception is raised if the directory doesn\(aqt have 0700 permissions or isn\(aqt owned by the current user. .UNINDENT .TP .B Returns Key .TP .B Return type \fI\%certbot.util.Key\fP .TP .B Raises \fBValueError\fP \-\- If unable to generate the key given key_size. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.crypto_util.generate_csr(privkey: \fI\%Key\fP, names: List[str] | Set[str], path: str | None, must_staple: bool = False, strict_permissions: bool = True) -> \fI\%CSR\fP Initialize a CSR with the given private key. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBprivkey\fP (\fI\%certbot.util.Key\fP) \-\- Key to include in the CSR .IP \(bu 2 \fBnames\fP (\fIset\fP) \-\- \fBstr\fP names to include in the CSR .IP \(bu 2 \fBpath\fP (\fIstr\fP) \-\- Optional certificate save directory. .IP \(bu 2 \fBmust_staple\fP (\fIbool\fP) \-\- If true, include the TLS Feature extension \(dqOCSP Must\-Staple\(dq .IP \(bu 2 \fBstrict_permissions\fP (\fIbool\fP) \-\- If true and path exists, an exception is raised if the directory doesn\(aqt have 0755 permissions or isn\(aqt owned by the current user. .UNINDENT .TP .B Returns CSR .TP .B Return type \fI\%certbot.util.CSR\fP .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.crypto_util.valid_csr(csr: bytes) -> bool Validate CSR. .sp Check if \fBcsr\fP is a valid CSR for the given domains. .INDENT 7.0 .TP .B Parameters \fBcsr\fP (\fIbytes\fP) \-\- CSR in PEM. .TP .B Returns Validity of CSR. .TP .B Return type bool .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.crypto_util.csr_matches_pubkey(csr: bytes, privkey: bytes) -> bool Does private key correspond to the subject public key in the CSR? .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBcsr\fP (\fIbytes\fP) \-\- CSR in PEM. .IP \(bu 2 \fBprivkey\fP (\fIbytes\fP) \-\- Private key file contents (PEM) .UNINDENT .TP .B Returns Correspondence of private key to CSR subject public key. .TP .B Return type bool .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.crypto_util.import_csr_file(csrfile: str, data: bytes) -> Tuple[int, \fI\%CSR\fP, List[str]] Import a CSR file, which can be either PEM or DER. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBcsrfile\fP (\fIstr\fP) \-\- CSR filename .IP \(bu 2 \fBdata\fP (\fIbytes\fP) \-\- contents of the CSR file .UNINDENT .TP .B Returns (\fBcrypto.FILETYPE_PEM\fP, util.CSR object representing the CSR, list of domains requested in the CSR) .TP .B Return type tuple .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.crypto_util.make_key(bits: int = 2048, key_type: str = \(aqrsa\(aq, elliptic_curve: str | None = None) -> bytes Generate PEM encoded RSA|EC key. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBbits\fP (\fIint\fP) \-\- Number of bits if key_type=rsa. At least 2048 for RSA. .IP \(bu 2 \fBkey_type\fP (\fIstr\fP) \-\- The type of key to generate, but be rsa or ecdsa .IP \(bu 2 \fBelliptic_curve\fP (\fIstr\fP) \-\- The elliptic curve to use. .UNINDENT .TP .B Returns new RSA or ECDSA key in PEM form with specified number of bits or of type ec_curve when key_type ecdsa is used. .TP .B Return type str .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.crypto_util.valid_privkey(privkey: str | bytes) -> bool Is valid RSA private key? .INDENT 7.0 .TP .B Parameters \fBprivkey\fP \-\- Private key file contents in PEM .TP .B Returns Validity of private key. .TP .B Return type bool .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.crypto_util.verify_renewable_cert(renewable_cert: \fI\%RenewableCert\fP) -> None For checking that your certs were not corrupted on disk. .INDENT 7.0 .TP .B Several things are checked: .INDENT 7.0 .IP 1. 3 Signature verification for the cert. .IP 2. 3 That fullchain matches cert and chain when concatenated. .IP 3. 3 Check that the private key matches the certificate. .UNINDENT .UNINDENT .INDENT 7.0 .TP .B Parameters \fBrenewable_cert\fP (\fI\%certbot.interfaces.RenewableCert\fP) \-\- cert to verify .TP .B Raises \fI\%errors.Error\fP \-\- If verification fails. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.crypto_util.verify_renewable_cert_sig(renewable_cert: \fI\%RenewableCert\fP) -> None Verifies the signature of a RenewableCert object. .INDENT 7.0 .TP .B Parameters \fBrenewable_cert\fP (\fI\%certbot.interfaces.RenewableCert\fP) \-\- cert to verify .TP .B Raises \fI\%errors.Error\fP \-\- If signature verification fails. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.crypto_util.verify_signed_payload(public_key: DSAPublicKey | Ed25519PublicKey | Ed448PublicKey | EllipticCurvePublicKey | RSAPublicKey | X25519PublicKey | X448PublicKey, signature: bytes, payload: bytes, signature_hash_algorithm: HashAlgorithm) -> None Check the signature of a payload. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBpublic_key\fP (\fIRSAPublicKey/EllipticCurvePublicKey\fP) \-\- the public_key to check signature .IP \(bu 2 \fBsignature\fP (\fIbytes\fP) \-\- the signature bytes .IP \(bu 2 \fBpayload\fP (\fIbytes\fP) \-\- the payload bytes .IP \(bu 2 \fBsignature_hash_algorithm\fP (\fIhashes.HashAlgorithm\fP) \-\- algorithm used to hash the payload .UNINDENT .TP .B Raises .INDENT 7.0 .IP \(bu 2 \fBInvalidSignature\fP \-\- If signature verification fails. .IP \(bu 2 \fI\%errors.Error\fP \-\- If public key type is not supported .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.crypto_util.verify_cert_matches_priv_key(cert_path: str, key_path: str) -> None Verifies that the private key and cert match. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBcert_path\fP (\fIstr\fP) \-\- path to a cert in PEM format .IP \(bu 2 \fBkey_path\fP (\fIstr\fP) \-\- path to a private key file .UNINDENT .TP .B Raises \fI\%errors.Error\fP \-\- If they don\(aqt match. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.crypto_util.verify_fullchain(renewable_cert: \fI\%RenewableCert\fP) -> None Verifies that fullchain is indeed cert concatenated with chain. .INDENT 7.0 .TP .B Parameters \fBrenewable_cert\fP (\fI\%certbot.interfaces.RenewableCert\fP) \-\- cert to verify .TP .B Raises \fI\%errors.Error\fP \-\- If cert and chain do not combine to fullchain. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.crypto_util.pyopenssl_load_certificate(data: bytes) -> Tuple[X509, int] Load PEM/DER certificate. .INDENT 7.0 .TP .B Raises \fI\%errors.Error\fP \-\- .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.crypto_util.get_sans_from_cert(cert: bytes, typ: int = 1) -> List[str] Get a list of Subject Alternative Names from a certificate. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBcert\fP (\fIstr\fP) \-\- Certificate (encoded). .IP \(bu 2 \fBtyp\fP \-\- \fBcrypto.FILETYPE_PEM\fP or \fBcrypto.FILETYPE_ASN1\fP .UNINDENT .TP .B Returns A list of Subject Alternative Names. .TP .B Return type list .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.crypto_util.get_names_from_cert(cert: bytes, typ: int = 1) -> List[str] Get a list of domains from a cert, including the CN if it is set. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBcert\fP (\fIstr\fP) \-\- Certificate (encoded). .IP \(bu 2 \fBtyp\fP \-\- \fBcrypto.FILETYPE_PEM\fP or \fBcrypto.FILETYPE_ASN1\fP .UNINDENT .TP .B Returns A list of domain names. .TP .B Return type list .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.crypto_util.get_names_from_req(csr: bytes, typ: int = 1) -> List[str] Get a list of domains from a CSR, including the CN if it is set. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBcsr\fP (\fIstr\fP) \-\- CSR (encoded). .IP \(bu 2 \fBtyp\fP \-\- \fBcrypto.FILETYPE_PEM\fP or \fBcrypto.FILETYPE_ASN1\fP .UNINDENT .TP .B Returns A list of domain names. .TP .B Return type list .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.crypto_util.dump_pyopenssl_chain(chain: List[X509] | List[ComparableX509], filetype: int = 1) -> bytes Dump certificate chain into a bundle. .INDENT 7.0 .TP .B Parameters \fBchain\fP (\fIlist\fP) \-\- List of \fBcrypto.X509\fP (or wrapped in \fBjosepy.util.ComparableX509\fP). .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.crypto_util.notBefore(cert_path: str) -> datetime When does the cert at cert_path start being valid? .INDENT 7.0 .TP .B Parameters \fBcert_path\fP (\fIstr\fP) \-\- path to a cert in PEM format .TP .B Returns the notBefore value from the cert at cert_path .TP .B Return type \fBdatetime.datetime\fP .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.crypto_util.notAfter(cert_path: str) -> datetime When does the cert at cert_path stop being valid? .INDENT 7.0 .TP .B Parameters \fBcert_path\fP (\fIstr\fP) \-\- path to a cert in PEM format .TP .B Returns the notAfter value from the cert at cert_path .TP .B Return type \fBdatetime.datetime\fP .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.crypto_util.sha256sum(filename: str) -> str Compute a sha256sum of a file. .sp NB: In given file, platform specific newlines characters will be converted into their equivalent unicode counterparts before calculating the hash. .INDENT 7.0 .TP .B Parameters \fBfilename\fP (\fIstr\fP) \-\- path to the file whose hash will be computed .TP .B Returns sha256 digest of the file in hexadecimal .TP .B Return type str .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.crypto_util.cert_and_chain_from_fullchain(fullchain_pem: str) -> Tuple[str, str] Split fullchain_pem into cert_pem and chain_pem .INDENT 7.0 .TP .B Parameters \fBfullchain_pem\fP (\fIstr\fP) \-\- concatenated cert + chain .TP .B Returns tuple of string cert_pem and chain_pem .TP .B Return type tuple .TP .B Raises \fI\%errors.Error\fP \-\- If there are less than 2 certificates in the chain. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.crypto_util.get_serial_from_cert(cert_path: str) -> int Retrieve the serial number of a certificate from certificate path .INDENT 7.0 .TP .B Parameters \fBcert_path\fP (\fIstr\fP) \-\- path to a cert in PEM format .TP .B Returns serial number of the certificate .TP .B Return type int .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.crypto_util.find_chain_with_issuer(fullchains: List[str], issuer_cn: str, warn_on_no_match: bool = False) -> str Chooses the first certificate chain from fullchains whose topmost intermediate has an Issuer Common Name matching issuer_cn (in other words the first chain which chains to a root whose name matches issuer_cn). .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBfullchains\fP (\fBlist\fP of \fBstr\fP) \-\- The list of fullchains in PEM chain format. .IP \(bu 2 \fBissuer_cn\fP (\fIstr\fP) \-\- The exact Subject Common Name to match against any issuer in the certificate chain. .UNINDENT .TP .B Returns The best\-matching fullchain, PEM\-encoded, or the first if none match. .TP .B Return type \fBstr\fP .UNINDENT .UNINDENT .SS certbot.errors module .sp Certbot client errors. .INDENT 0.0 .TP .B exception certbot.errors.Error Bases: \fBException\fP .sp Generic Certbot client error. .UNINDENT .INDENT 0.0 .TP .B exception certbot.errors.AccountStorageError Bases: \fI\%Error\fP .sp Generic \fI\%AccountStorage\fP error. .UNINDENT .INDENT 0.0 .TP .B exception certbot.errors.AccountNotFound Bases: \fI\%AccountStorageError\fP .sp Account not found error. .UNINDENT .INDENT 0.0 .TP .B exception certbot.errors.ReverterError Bases: \fI\%Error\fP .sp Certbot Reverter error. .UNINDENT .INDENT 0.0 .TP .B exception certbot.errors.SubprocessError Bases: \fI\%Error\fP .sp Subprocess handling error. .UNINDENT .INDENT 0.0 .TP .B exception certbot.errors.CertStorageError Bases: \fI\%Error\fP .sp Generic \fBCertStorage\fP error. .UNINDENT .INDENT 0.0 .TP .B exception certbot.errors.HookCommandNotFound Bases: \fI\%Error\fP .sp Failed to find a hook command in the PATH. .UNINDENT .INDENT 0.0 .TP .B exception certbot.errors.SignalExit Bases: \fI\%Error\fP .sp A Unix signal was received while in the ErrorHandler context manager. .UNINDENT .INDENT 0.0 .TP .B exception certbot.errors.OverlappingMatchFound Bases: \fI\%Error\fP .sp Multiple lineages matched what should have been a unique result. .UNINDENT .INDENT 0.0 .TP .B exception certbot.errors.LockError Bases: \fI\%Error\fP .sp File locking error. .UNINDENT .INDENT 0.0 .TP .B exception certbot.errors.AuthorizationError Bases: \fI\%Error\fP .sp Authorization error. .UNINDENT .INDENT 0.0 .TP .B exception certbot.errors.FailedChallenges(failed_achalls: Set[\fI\%AnnotatedChallenge\fP]) Bases: \fI\%AuthorizationError\fP .sp Failed challenges error. .INDENT 7.0 .TP .B Variables \fBfailed_achalls\fP (\fIset\fP) \-\- Failed \fI\%AnnotatedChallenge\fP instances. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B exception certbot.errors.PluginError Bases: \fI\%Error\fP .sp Certbot Plugin error. .UNINDENT .INDENT 0.0 .TP .B exception certbot.errors.PluginEnhancementAlreadyPresent Bases: \fI\%Error\fP .sp Enhancement was already set .UNINDENT .INDENT 0.0 .TP .B exception certbot.errors.PluginSelectionError Bases: \fI\%Error\fP .sp A problem with plugin/configurator selection or setup .UNINDENT .INDENT 0.0 .TP .B exception certbot.errors.NoInstallationError Bases: \fI\%PluginError\fP .sp Certbot No Installation error. .UNINDENT .INDENT 0.0 .TP .B exception certbot.errors.MisconfigurationError Bases: \fI\%PluginError\fP .sp Certbot Misconfiguration error. .UNINDENT .INDENT 0.0 .TP .B exception certbot.errors.NotSupportedError Bases: \fI\%PluginError\fP .sp Certbot Plugin function not supported error. .UNINDENT .INDENT 0.0 .TP .B exception certbot.errors.PluginStorageError Bases: \fI\%PluginError\fP .sp Certbot Plugin Storage error. .UNINDENT .INDENT 0.0 .TP .B exception certbot.errors.StandaloneBindError(socket_error: OSError, port: int) Bases: \fI\%Error\fP .sp Standalone plugin bind error. .UNINDENT .INDENT 0.0 .TP .B exception certbot.errors.ConfigurationError Bases: \fI\%Error\fP .sp Configuration sanity error. .UNINDENT .INDENT 0.0 .TP .B exception certbot.errors.MissingCommandlineFlag Bases: \fI\%Error\fP .sp A command line argument was missing in noninteractive usage .UNINDENT .SS certbot.interfaces module .sp Certbot client interfaces. .INDENT 0.0 .TP .B class certbot.interfaces.AccountStorage Bases: \fBobject\fP .sp Accounts storage interface. .INDENT 7.0 .TP .B abstract find_all() -> List[Account] Find all accounts. .INDENT 7.0 .TP .B Returns All found accounts. .TP .B Return type list .UNINDENT .UNINDENT .INDENT 7.0 .TP .B abstract load(account_id: str) -> Account Load an account by its id. .INDENT 7.0 .TP .B Raises .INDENT 7.0 .IP \(bu 2 \fB\&.AccountNotFound\fP \-\- if account could not be found .IP \(bu 2 \fB\&.AccountStorageError\fP \-\- if account could not be loaded .UNINDENT .TP .B Returns The account loaded .TP .B Return type \&.Account .UNINDENT .UNINDENT .INDENT 7.0 .TP .B abstract save(account: Account, client: ClientV2) -> None Save account. .INDENT 7.0 .TP .B Raises \fB\&.AccountStorageError\fP \-\- if account could not be saved .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class certbot.interfaces.Plugin(config: NamespaceConfig | None, name: str) Bases: \fBobject\fP .sp Certbot plugin. .sp Objects providing this interface will be called without satisfying any entry point \(dqextras\(dq (extra dependencies) you might have defined for your plugin, e.g (excerpt from \fBsetup.py\fP script): .INDENT 7.0 .INDENT 3.5 .sp .EX setup( ... entry_points={ \(aqcertbot.plugins\(aq: [ \(aqname=example_project.plugin[plugin_deps]\(aq, ], }, extras_require={ \(aqplugin_deps\(aq: [\(aqdep1\(aq, \(aqdep2\(aq], } ) .EE .UNINDENT .UNINDENT .sp Therefore, make sure such objects are importable and usable without extras. This is necessary, because CLI does the following operations (in order): .INDENT 7.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 loads an entry point, .IP \(bu 2 calls \fI\%inject_parser_options\fP, .IP \(bu 2 requires an entry point, .IP \(bu 2 creates plugin instance (\fB__call__\fP). .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B description: str = NotImplemented Short plugin description .UNINDENT .INDENT 7.0 .TP .B name: str = NotImplemented Unique name of the plugin .UNINDENT .INDENT 7.0 .TP .B abstract prepare() -> None Prepare the plugin. .sp Finish up any additional initialization. .INDENT 7.0 .TP .B Raises .INDENT 7.0 .IP \(bu 2 \fB\&.PluginError\fP \-\- when full initialization cannot be completed. .IP \(bu 2 \fB\&.MisconfigurationError\fP \-\- when full initialization cannot be completed. Plugin will be displayed on a list of available plugins. .IP \(bu 2 \fB\&.NoInstallationError\fP \-\- when the necessary programs/files cannot be located. Plugin will NOT be displayed on a list of available plugins. .IP \(bu 2 \fB\&.NotSupportedError\fP \-\- when the installation is recognized, but the version is not currently supported. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B abstract more_info() -> str Human\-readable string to help the user. .sp Should describe the steps taken and any relevant info to help the user decide which plugin to use. .INDENT 7.0 .TP .B Rtype str .UNINDENT .UNINDENT .INDENT 7.0 .TP .B abstract classmethod inject_parser_options(parser: ArgumentParser, name: str) -> None Inject argument parser options (flags). .sp 1. Be nice and prepend all options and destinations with \fI\%option_namespace\fP and \fBdest_namespace\fP\&. .sp 2. Inject options (flags) only. Positional arguments are not allowed, as this would break the CLI. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBparser\fP (\fIArgumentParser\fP) \-\- (Almost) top\-level CLI parser. .IP \(bu 2 \fBname\fP (\fIstr\fP) \-\- Unique plugin name. .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class certbot.interfaces.Authenticator(config: NamespaceConfig | None, name: str) Bases: \fI\%Plugin\fP .sp Generic Certbot Authenticator. .sp Class represents all possible tools processes that have the ability to perform challenges and attain a certificate. .INDENT 7.0 .TP .B abstract get_chall_pref(domain: str) -> Iterable[Type[Challenge]] Return \fBcollections.Iterable\fP of challenge preferences. .INDENT 7.0 .TP .B Parameters \fBdomain\fP (\fIstr\fP) \-\- Domain for which challenge preferences are sought. .TP .B Returns \fBcollections.Iterable\fP of challenge types (subclasses of \fBacme.challenges.Challenge\fP) with the most preferred challenges first. If a type is not specified, it means the Authenticator cannot perform the challenge. .TP .B Return type \fBcollections.Iterable\fP .UNINDENT .UNINDENT .INDENT 7.0 .TP .B abstract perform(achalls: List[\fI\%AnnotatedChallenge\fP]) -> List[ChallengeResponse] Perform the given challenge. .INDENT 7.0 .TP .B Parameters \fBachalls\fP (\fIlist\fP) \-\- Non\-empty (guaranteed) list of \fI\%AnnotatedChallenge\fP instances, such that it contains types found within \fI\%get_chall_pref()\fP only. .TP .B Returns list of ACME \fBChallengeResponse\fP instances corresponding to each provided \fBChallenge\fP\&. .TP .B Return type \fBcollections.List\fP of \fBacme.challenges.ChallengeResponse\fP, where responses are required to be returned in the same order as corresponding input challenges .TP .B Raises \fB\&.PluginError\fP \-\- If some or all challenges cannot be performed .UNINDENT .UNINDENT .INDENT 7.0 .TP .B abstract cleanup(achalls: List[\fI\%AnnotatedChallenge\fP]) -> None Revert changes and shutdown after challenges complete. .sp This method should be able to revert all changes made by perform, even if perform exited abnormally. .INDENT 7.0 .TP .B Parameters \fBachalls\fP (\fIlist\fP) \-\- Non\-empty (guaranteed) list of \fI\%AnnotatedChallenge\fP instances, a subset of those previously passed to \fI\%perform()\fP\&. .TP .B Raises \fI\%PluginError\fP \-\- if original configuration cannot be restored .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class certbot.interfaces.Installer(config: NamespaceConfig | None, name: str) Bases: \fI\%Plugin\fP .sp Generic Certbot Installer Interface. .sp Represents any server that an X509 certificate can be placed. .sp It is assumed that \fI\%save()\fP is the only method that finalizes a checkpoint. This is important to ensure that checkpoints are restored in a consistent manner if requested by the user or in case of an error. .sp Using \fI\%certbot.reverter.Reverter\fP to implement checkpoints, rollback, and recovery can dramatically simplify plugin development. .INDENT 7.0 .TP .B abstract get_all_names() -> Iterable[str] Returns all names that may be authenticated. .INDENT 7.0 .TP .B Return type \fBcollections.Iterable\fP of \fBstr\fP .UNINDENT .UNINDENT .INDENT 7.0 .TP .B abstract deploy_cert(domain: str, cert_path: str, key_path: str, chain_path: str, fullchain_path: str) -> None Deploy certificate. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBdomain\fP (\fIstr\fP) \-\- domain to deploy certificate file .IP \(bu 2 \fBcert_path\fP (\fIstr\fP) \-\- absolute path to the certificate file .IP \(bu 2 \fBkey_path\fP (\fIstr\fP) \-\- absolute path to the private key file .IP \(bu 2 \fBchain_path\fP (\fIstr\fP) \-\- absolute path to the certificate chain file .IP \(bu 2 \fBfullchain_path\fP (\fIstr\fP) \-\- absolute path to the certificate fullchain file (cert plus chain) .UNINDENT .TP .B Raises \fB\&.PluginError\fP \-\- when cert cannot be deployed .UNINDENT .UNINDENT .INDENT 7.0 .TP .B abstract enhance(domain: str, enhancement: str, options: List[str] | str | None = None) -> None Perform a configuration enhancement. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBdomain\fP (\fIstr\fP) \-\- domain for which to provide enhancement .IP \(bu 2 \fBenhancement\fP (\fIstr\fP) \-\- An enhancement as defined in \fI\%ENHANCEMENTS\fP .IP \(bu 2 \fBoptions\fP \-\- Flexible options parameter for enhancement. Check documentation of \fI\%ENHANCEMENTS\fP for expected options for each enhancement. .UNINDENT .TP .B Raises \fB\&.PluginError\fP \-\- If Enhancement is not supported, or if an error occurs during the enhancement. .UNINDENT .UNINDENT .INDENT 7.0 .TP .B abstract supported_enhancements() -> List[str] Returns a \fBcollections.Iterable\fP of supported enhancements. .INDENT 7.0 .TP .B Returns supported enhancements which should be a subset of \fI\%ENHANCEMENTS\fP .TP .B Return type \fBcollections.Iterable\fP of \fBstr\fP .UNINDENT .UNINDENT .INDENT 7.0 .TP .B abstract save(title: str | None = None, temporary: bool = False) -> None Saves all changes to the configuration files. .sp Both title and temporary are needed because a save may be intended to be permanent, but the save is not ready to be a full checkpoint. .sp It is assumed that at most one checkpoint is finalized by this method. Additionally, if an exception is raised, it is assumed a new checkpoint was not finalized. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBtitle\fP (\fIstr\fP) \-\- The title of the save. If a title is given, the configuration will be saved as a new checkpoint and put in a timestamped directory. \fBtitle\fP has no effect if temporary is true. .IP \(bu 2 \fBtemporary\fP (\fIbool\fP) \-\- Indicates whether the changes made will be quickly reversed in the future (challenges) .UNINDENT .TP .B Raises \fB\&.PluginError\fP \-\- when save is unsuccessful .UNINDENT .UNINDENT .INDENT 7.0 .TP .B abstract rollback_checkpoints(rollback: int = 1) -> None Revert \fBrollback\fP number of configuration checkpoints. .INDENT 7.0 .TP .B Raises \fB\&.PluginError\fP \-\- when configuration cannot be fully reverted .UNINDENT .UNINDENT .INDENT 7.0 .TP .B abstract recovery_routine() -> None Revert configuration to most recent finalized checkpoint. .sp Remove all changes (temporary and permanent) that have not been finalized. This is useful to protect against crashes and other execution interruptions. .INDENT 7.0 .TP .B Raises \fB\&.errors.PluginError\fP \-\- If unable to recover the configuration .UNINDENT .UNINDENT .INDENT 7.0 .TP .B abstract config_test() -> None Make sure the configuration is valid. .INDENT 7.0 .TP .B Raises \fB\&.MisconfigurationError\fP \-\- when the config is not in a usable state .UNINDENT .UNINDENT .INDENT 7.0 .TP .B abstract restart() -> None Restart or refresh the server content. .INDENT 7.0 .TP .B Raises \fB\&.PluginError\fP \-\- when server cannot be restarted .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class certbot.interfaces.RenewableCert Bases: \fBobject\fP .sp Interface to a certificate lineage. .INDENT 7.0 .TP .B abstract property cert_path: str Path to the certificate file. .INDENT 7.0 .TP .B Return type str .UNINDENT .UNINDENT .INDENT 7.0 .TP .B abstract property key_path: str Path to the private key file. .INDENT 7.0 .TP .B Return type str .UNINDENT .UNINDENT .INDENT 7.0 .TP .B abstract property chain_path: str Path to the certificate chain file. .INDENT 7.0 .TP .B Return type str .UNINDENT .UNINDENT .INDENT 7.0 .TP .B abstract property fullchain_path: str Path to the full chain file. .sp The full chain is the certificate file plus the chain file. .INDENT 7.0 .TP .B Return type str .UNINDENT .UNINDENT .INDENT 7.0 .TP .B abstract property lineagename: str Name given to the certificate lineage. .INDENT 7.0 .TP .B Return type str .UNINDENT .UNINDENT .INDENT 7.0 .TP .B abstract names() -> List[str] What are the subject names of this certificate? .INDENT 7.0 .TP .B Returns the subject names .TP .B Return type \fBlist\fP of \fBstr\fP .TP .B Raises \fB\&.CertStorageError\fP \-\- if could not find cert file. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class certbot.interfaces.GenericUpdater Bases: \fBobject\fP .sp Interface for update types not currently specified by Certbot. .sp This class allows plugins to perform types of updates that Certbot hasn\(aqt defined (yet). .sp To make use of this interface, the installer should implement the interface methods, and interfaces.GenericUpdater.register(InstallerClass) should be called from the installer code. .sp The plugins implementing this enhancement are responsible of handling the saving of configuration checkpoints as well as other calls to interface methods of \fBinterfaces.Installer\fP such as prepare() and restart() .INDENT 7.0 .TP .B abstract generic_updates(lineage: \fI\%RenewableCert\fP, *args: Any, **kwargs: Any) -> None Perform any update types defined by the installer. .sp If an installer is a subclass of the class containing this method, this function will always be called when \(dqcertbot renew\(dq is run. If the update defined by the installer should be run conditionally, the installer needs to handle checking the conditions itself. .sp This method is called once for each lineage. .INDENT 7.0 .TP .B Parameters \fBlineage\fP (\fI\%RenewableCert\fP) \-\- Certificate lineage object .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class certbot.interfaces.RenewDeployer Bases: \fBobject\fP .sp Interface for update types run when a lineage is renewed .sp This class allows plugins to perform types of updates that need to run at lineage renewal that Certbot hasn\(aqt defined (yet). .sp To make use of this interface, the installer should implement the interface methods, and interfaces.RenewDeployer.register(InstallerClass) should be called from the installer code. .INDENT 7.0 .TP .B abstract renew_deploy(lineage: \fI\%RenewableCert\fP, *args: Any, **kwargs: Any) -> None Perform updates defined by installer when a certificate has been renewed .sp If an installer is a subclass of the class containing this method, this function will always be called when a certificate has been renewed by running \(dqcertbot renew\(dq. For example if a plugin needs to copy a certificate over, or change configuration based on the new certificate. .sp This method is called once for each lineage renewed .INDENT 7.0 .TP .B Parameters \fBlineage\fP (\fI\%RenewableCert\fP) \-\- Certificate lineage object .UNINDENT .UNINDENT .UNINDENT .SS certbot.main module .sp Certbot main public entry point. .INDENT 0.0 .TP .B certbot.main.main(cli_args: List[str] | None = None) -> str | int | None Run Certbot. .INDENT 7.0 .TP .B Parameters \fBcli_args\fP (\fBlist\fP of \fBstr\fP) \-\- command line to Certbot, defaults to \fBsys.argv[1:]\fP .TP .B Returns value for \fBsys.exit\fP about the exit status of Certbot .TP .B Return type \fBstr\fP or \fBint\fP or \fBNone\fP .UNINDENT .UNINDENT .SS certbot.ocsp package .sp Tools for checking certificate revocation. .INDENT 0.0 .TP .B class certbot.ocsp.RevocationChecker(enforce_openssl_binary_usage: bool = False) Bases: \fBobject\fP .sp This class figures out OCSP checking on this system, and performs it. .INDENT 7.0 .TP .B ocsp_revoked(cert: \fI\%RenewableCert\fP) -> bool Get revoked status for a particular cert version. .INDENT 7.0 .TP .B Parameters \fBcert\fP (\fI\%interfaces.RenewableCert\fP) \-\- Certificate object .TP .B Returns True if revoked; False if valid or the check failed or cert is expired. .TP .B Return type bool .UNINDENT .UNINDENT .INDENT 7.0 .TP .B ocsp_revoked_by_paths(cert_path: str, chain_path: str, timeout: int = 10) -> bool Performs the OCSP revocation check .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBcert_path\fP (\fIstr\fP) \-\- Certificate filepath .IP \(bu 2 \fBchain_path\fP (\fIstr\fP) \-\- Certificate chain .IP \(bu 2 \fBtimeout\fP (\fIint\fP) \-\- Timeout (in seconds) for the OCSP query .UNINDENT .TP .B Returns True if revoked; False if valid or the check failed or cert is expired. .TP .B Return type bool .UNINDENT .UNINDENT .UNINDENT .SS certbot.reverter module .sp Reverter class saves configuration checkpoints and allows for recovery. .INDENT 0.0 .TP .B class certbot.reverter.Reverter(config: NamespaceConfig) Bases: \fBobject\fP .sp Reverter Class \- save and revert configuration checkpoints. .sp This class can be used by the plugins, especially Installers, to undo changes made to the user\(aqs system. Modifications to files and commands to do undo actions taken by the plugin should be registered with this class before the action is taken. .sp Once a change has been registered with this class, there are three states the change can be in. First, the change can be a temporary change. This should be used for changes that will soon be reverted, such as config changes for the purpose of solving a challenge. Changes are added to this state through calls to \fI\%add_to_temp_checkpoint()\fP and reverted when \fI\%revert_temporary_config()\fP or \fI\%recovery_routine()\fP is called. .sp The second state a change can be in is in progress. These changes are not temporary, however, they also have not been finalized in a checkpoint. A change must become in progress before it can be finalized. Changes are added to this state through calls to \fI\%add_to_checkpoint()\fP and reverted when \fI\%recovery_routine()\fP is called. .sp The last state a change can be in is finalized in a checkpoint. A change is put into this state by first becoming an in progress change and then calling \fI\%finalize_checkpoint()\fP\&. Changes in this state can be reverted through calls to \fI\%rollback_checkpoints()\fP\&. .sp As a final note, creating new files and registering undo commands are handled specially and use the methods \fI\%register_file_creation()\fP and \fI\%register_undo_command()\fP respectively. Both of these methods can be used to create either temporary or in progress changes. .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 Consider moving everything over to CSV format. .UNINDENT .UNINDENT .INDENT 7.0 .TP .B Parameters \fBconfig\fP (\fBcertbot.configuration.NamespaceConfig\fP) \-\- Configuration. .UNINDENT .INDENT 7.0 .TP .B revert_temporary_config() -> None Reload users original configuration files after a temporary save. .sp This function should reinstall the users original configuration files for all saves with temporary=True .INDENT 7.0 .TP .B Raises \fB\&.ReverterError\fP \-\- when unable to revert config .UNINDENT .UNINDENT .INDENT 7.0 .TP .B rollback_checkpoints(rollback: int = 1) -> None Revert \(aqrollback\(aq number of configuration checkpoints. .INDENT 7.0 .TP .B Parameters \fBrollback\fP (\fIint\fP) \-\- Number of checkpoints to reverse. A str num will be cast to an integer. So \(dq2\(dq is also acceptable. .TP .B Raises \fB\&.ReverterError\fP \-\- if there is a problem with the input or if the function is unable to correctly revert the configuration checkpoints .UNINDENT .UNINDENT .INDENT 7.0 .TP .B add_to_temp_checkpoint(save_files: Set[str], save_notes: str) -> None Add files to temporary checkpoint. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBsave_files\fP (\fIset\fP) \-\- set of filepaths to save .IP \(bu 2 \fBsave_notes\fP (\fIstr\fP) \-\- notes about changes during the save .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B add_to_checkpoint(save_files: Set[str], save_notes: str) -> None Add files to a permanent checkpoint. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBsave_files\fP (\fIset\fP) \-\- set of filepaths to save .IP \(bu 2 \fBsave_notes\fP (\fIstr\fP) \-\- notes about changes during the save .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B register_file_creation(temporary: bool, *files: str) -> None Register the creation of all files during certbot execution. .sp Call this method before writing to the file to make sure that the file will be cleaned up if the program exits unexpectedly. (Before a save occurs) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBtemporary\fP (\fIbool\fP) \-\- If the file creation registry is for a temp or permanent save. .IP \(bu 2 \fB*files\fP \-\- file paths (str) to be registered .UNINDENT .TP .B Raises \fI\%certbot.errors.ReverterError\fP \-\- If call does not contain necessary parameters or if the file creation is unable to be registered. .UNINDENT .UNINDENT .INDENT 7.0 .TP .B register_undo_command(temporary: bool, command: Iterable[str]) -> None Register a command to be run to undo actions taken. .sp \fBWARNING:\fP .INDENT 7.0 .INDENT 3.5 This function does not enforce order of operations in terms of file modification vs. command registration. All undo commands are run first before all normal files are reverted to their previous state. If you need to maintain strict order, you may create checkpoints before and after the the command registration. This function may be improved in the future based on demand. .UNINDENT .UNINDENT .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBtemporary\fP (\fIbool\fP) \-\- Whether the command should be saved in the IN_PROGRESS or TEMPORARY checkpoints. .IP \(bu 2 \fBcommand\fP (\fIlist\fP\fI of \fP\fIstr\fP) \-\- Command to be run. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B recovery_routine() -> None Revert configuration to most recent finalized checkpoint. .sp Remove all changes (temporary and permanent) that have not been finalized. This is useful to protect against crashes and other execution interruptions. .INDENT 7.0 .TP .B Raises \fB\&.errors.ReverterError\fP \-\- If unable to recover the configuration .UNINDENT .UNINDENT .INDENT 7.0 .TP .B finalize_checkpoint(title: str) -> None Finalize the checkpoint. .sp Timestamps and permanently saves all changes made through the use of \fI\%add_to_checkpoint()\fP and \fI\%register_file_creation()\fP .INDENT 7.0 .TP .B Parameters \fBtitle\fP (\fIstr\fP) \-\- Title describing checkpoint .TP .B Raises \fI\%certbot.errors.ReverterError\fP \-\- when the checkpoint is not able to be finalized. .UNINDENT .UNINDENT .UNINDENT .SS certbot.util module .sp Utilities for all Certbot. .INDENT 0.0 .TP .B class certbot.util.Key(file: str | None, pem: bytes) Bases: \fBNamedTuple\fP .sp Container for an optional file path and contents for a PEM\-formated private key. .INDENT 7.0 .TP .B file: str | None Alias for field number 0 .UNINDENT .INDENT 7.0 .TP .B pem: bytes Alias for field number 1 .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class certbot.util.CSR(file: str | None, data: bytes, form: str) Bases: \fBNamedTuple\fP .sp Container for an optional file path and contents for a PEM or DER\-formatted CSR. .INDENT 7.0 .TP .B file: str | None Alias for field number 0 .UNINDENT .INDENT 7.0 .TP .B data: bytes Alias for field number 1 .UNINDENT .INDENT 7.0 .TP .B form: str Alias for field number 2 .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class certbot.util.LooseVersion(version_string: str) Bases: \fBobject\fP .sp A version with loose rules, i.e. any given string is a valid version number. .sp but regular comparison is not supported. Instead, the \fI\%try_risky_comparison\fP method is provided, which may return an error if two LooseVersions are \(aqincomparible\(aq. For example when integer and string version components are present in the same position. .sp Differences with old distutils.version.LooseVersion: (\fI\%https://github.com/python/cpython/blob/v3.10.0/Lib/distutils/version.py#L269\fP) Most version comparisons should give the same result. However, if a version has multiple trailing zeroes, not all of them are used in the comparison. This ensure that, for example, \(dq2.0\(dq and \(dq2.0.0\(dq are equal. .INDENT 7.0 .TP .B try_risky_comparison(other: \fI\%LooseVersion\fP) -> int Compares the LooseVersion to another value. .sp If the other value is another LooseVersion, the version components are compared. Otherwise, an exception is raised. .sp Comparison is performed element\-wise. If the version components being compared are of different types, the two versions are considered incomparible. Otherwise, if either of the components is not equal to the other, less or greater is returned based on the comparison\(aqs result. In case the two versions are of different lengths, some elements in the longer version have not yet been compared. If these are all equal to zero, the two versions are equal. Otherwise, the longer version is greater. .sp If the two versions are incomparible, an exception is raised. Otherwise, the returned integer indicates the result of the comparison. If self == other, 0 is returned. If self > other, 1 is returned. If self < other \-1 is returned. .sp Examples: Equality: \- LooseVersion(\(aq1.0\(aq).try_risky_comparison(LooseVersion(\(aq1.0\(aq)) \-> 0 \- LooseVersion(\(aq2.0.0a\(aq).try_risky_comparison(LooseVersion(\(aq2.0.0a\(aq)) \-> 0 Inequality: \- LooseVersion(\(aq2.0.0\(aq).try_risky_comparison(LooseVersion(\(aq1.0\(aq)) \-> 1 \- LooseVersion(\(aq1.0.1\(aq).try_risky_comparison(LooseVersion(\(aq2.0a\(aq)) \-> \-1 Incomparability: \- LooseVersion(\(aq1a\(aq).try_risky_comparison(LooseVersion(\(aq1.0\(aq)) \-> ValueError .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.util.env_no_snap_for_external_calls() -> Dict[str, str] When Certbot is run inside a Snap, certain environment variables are modified. But Certbot sometimes calls out to external programs, since it uses classic confinement. When we do that, we must modify the env to remove our modifications so it will use the system\(aqs libraries, since they may be incompatible with the versions of libraries included in the Snap. For example, apachectl, Nginx, and anything run from inside a hook should call this function and pass the results into the \fBenv\fP argument of \fBsubprocess.Popen\fP\&. .INDENT 7.0 .TP .B Returns A modified copy of os.environ ready to pass to Popen .TP .B Return type dict .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.util.run_script(params: ~typing.List[str], log: ~typing.Callable[[str], None] = >) -> Tuple[str, str] Run the script with the given params. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBparams\fP (\fIlist\fP) \-\- List of parameters to pass to subprocess.run .IP \(bu 2 \fBlog\fP (\fIcallable\fP) \-\- Logger method to use for errors .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.util.exe_exists(exe: str) -> bool Determine whether path/name refers to an executable. .INDENT 7.0 .TP .B Parameters \fBexe\fP (\fIstr\fP) \-\- Executable path or name .TP .B Returns If exe is a valid executable .TP .B Return type bool .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.util.lock_dir_until_exit(dir_path: str) -> None Lock the directory at dir_path until program exit. .INDENT 7.0 .TP .B Parameters \fBdir_path\fP (\fIstr\fP) \-\- path to directory .TP .B Raises \fI\%errors.LockError\fP \-\- if the lock is held by another process .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.util.set_up_core_dir(directory: str, mode: int, strict: bool) -> None Ensure directory exists with proper permissions and is locked. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBdirectory\fP (\fIstr\fP) \-\- Path to a directory. .IP \(bu 2 \fBmode\fP (\fIint\fP) \-\- Directory mode. .IP \(bu 2 \fBstrict\fP (\fIbool\fP) \-\- require directory to be owned by current user .UNINDENT .TP .B Raises .INDENT 7.0 .IP \(bu 2 \fB\&.errors.LockError\fP \-\- if the directory cannot be locked .IP \(bu 2 \fB\&.errors.Error\fP \-\- if the directory cannot be made or verified .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.util.make_or_verify_dir(directory: str, mode: int = 493, strict: bool = False) -> None Make sure directory exists with proper permissions. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBdirectory\fP (\fIstr\fP) \-\- Path to a directory. .IP \(bu 2 \fBmode\fP (\fIint\fP) \-\- Directory mode. .IP \(bu 2 \fBstrict\fP (\fIbool\fP) \-\- require directory to be owned by current user .UNINDENT .TP .B Raises .INDENT 7.0 .IP \(bu 2 \fB\&.errors.Error\fP \-\- if a directory already exists, but has wrong permissions or owner .IP \(bu 2 \fBOSError\fP \-\- if invalid or inaccessible file names and paths, or other arguments that have the correct type, but are not accepted by the operating system. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.util.safe_open(path: str, mode: str = \(aqw\(aq, chmod: int | None = None) -> IO Safely open a file. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBpath\fP (\fIstr\fP) \-\- Path to a file. .IP \(bu 2 \fBmode\fP (\fIstr\fP) \-\- Same os \fBmode\fP for \fBopen\fP\&. .IP \(bu 2 \fBchmod\fP (\fIint\fP) \-\- Same as \fBmode\fP for \fBfilesystem.open\fP, uses Python defaults if \fBNone\fP\&. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.util.unique_file(path: str, chmod: int = 511, mode: str = \(aqw\(aq) -> Tuple[IO, str] Safely finds a unique file. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBpath\fP (\fIstr\fP) \-\- path/filename.ext .IP \(bu 2 \fBchmod\fP (\fIint\fP) \-\- File mode .IP \(bu 2 \fBmode\fP (\fIstr\fP) \-\- Open mode .UNINDENT .TP .B Returns tuple of file object and file name .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.util.unique_lineage_name(path: str, filename: str, chmod: int = 420, mode: str = \(aqw\(aq) -> Tuple[IO, str] Safely finds a unique file using lineage convention. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBpath\fP (\fIstr\fP) \-\- directory path .IP \(bu 2 \fBfilename\fP (\fIstr\fP) \-\- proposed filename .IP \(bu 2 \fBchmod\fP (\fIint\fP) \-\- file mode .IP \(bu 2 \fBmode\fP (\fIstr\fP) \-\- open mode .UNINDENT .TP .B Returns tuple of file object and file name (which may be modified from the requested one by appending digits to ensure uniqueness) .TP .B Raises \fBOSError\fP \-\- if writing files fails for an unanticipated reason, such as a full disk or a lack of permission to write to specified location. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.util.safely_remove(path: str) -> None Remove a file that may not exist. .UNINDENT .INDENT 0.0 .TP .B certbot.util.get_filtered_names(all_names: Set[str]) -> Set[str] Removes names that aren\(aqt considered valid by Let\(aqs Encrypt. .INDENT 7.0 .TP .B Parameters \fBall_names\fP (\fIset\fP) \-\- all names found in the configuration .TP .B Returns all found names that are considered valid by LE .TP .B Return type set .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.util.get_os_info() -> Tuple[str, str] Get OS name and version .INDENT 7.0 .TP .B Returns (os_name, os_version) .TP .B Return type \fBtuple\fP of \fBstr\fP .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.util.get_os_info_ua() -> str Get OS name and version string for User Agent .INDENT 7.0 .TP .B Returns os_ua .TP .B Return type \fBstr\fP .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.util.get_systemd_os_like() -> List[str] Get a list of strings that indicate the distribution likeness to other distributions. .INDENT 7.0 .TP .B Returns List of distribution acronyms .TP .B Return type \fBlist\fP of \fBstr\fP .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.util.get_var_from_file(varname: str, filepath: str = \(aq/etc/os\-release\(aq) -> str Get single value from a file formatted like systemd /etc/os\-release .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBvarname\fP (\fIstr\fP) \-\- Name of variable to fetch .IP \(bu 2 \fBfilepath\fP (\fIstr\fP) \-\- File path of os\-release file .UNINDENT .TP .B Returns requested value .TP .B Return type \fBstr\fP .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.util.get_python_os_info(pretty: bool = False) -> Tuple[str, str] Get Operating System type/distribution and major version using python platform module .INDENT 7.0 .TP .B Parameters \fBpretty\fP (\fIbool\fP) \-\- If the returned OS name should be in longer (pretty) form .TP .B Returns (os_name, os_version) .TP .B Return type \fBtuple\fP of \fBstr\fP .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.util.safe_email(email: str) -> bool Scrub email address before using it. .UNINDENT .INDENT 0.0 .TP .B class certbot.util.DeprecatedArgumentAction(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None) Bases: \fBAction\fP .sp Action to log a warning when an argument is used. .UNINDENT .INDENT 0.0 .TP .B certbot.util.add_deprecated_argument(add_argument: Callable[[\&...], None], argument_name: str, nargs: str | int) -> None Adds a deprecated argument with the name argument_name. .sp Deprecated arguments are not shown in the help. If they are used on the command line, a warning is shown stating that the argument is deprecated and no other action is taken. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBadd_argument\fP (\fIcallable\fP) \-\- Function that adds arguments to an argument parser/group. .IP \(bu 2 \fBargument_name\fP (\fIstr\fP) \-\- Name of deprecated argument. .IP \(bu 2 \fBnargs\fP \-\- Value for nargs when adding the argument to argparse. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.util.enforce_le_validity(domain: str) -> str Checks that Let\(aqs Encrypt will consider domain to be valid. .INDENT 7.0 .TP .B Parameters \fBdomain\fP (\fBstr\fP) \-\- FQDN to check .TP .B Returns The domain cast to \fBstr\fP, with ASCII\-only contents .TP .B Return type str .TP .B Raises \fI\%ConfigurationError\fP \-\- for invalid domains and cases where Let\(aqs Encrypt currently will not issue certificates .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.util.enforce_domain_sanity(domain: str | bytes) -> str Method which validates domain value and errors out if the requirements are not met. .INDENT 7.0 .TP .B Parameters \fBdomain\fP (\fBstr\fP or \fBbytes\fP) \-\- Domain to check .TP .B Raises \fI\%ConfigurationError\fP \-\- for invalid domains and cases where Let\(aqs Encrypt currently will not issue certificates .TP .B Returns The domain cast to \fBstr\fP, with ASCII\-only contents .TP .B Return type str .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.util.is_ipaddress(address: str) -> bool Is given address string form of IP(v4 or v6) address? .INDENT 7.0 .TP .B Parameters \fBaddress\fP (\fBstr\fP) \-\- address to check .TP .B Returns True if address is valid IP address, otherwise return False. .TP .B Return type bool .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.util.is_wildcard_domain(domain: str | bytes) -> bool \(dqIs domain a wildcard domain? .INDENT 7.0 .TP .B Parameters \fBdomain\fP (\fBbytes\fP or \fBstr\fP) \-\- domain to check .TP .B Returns True if domain is a wildcard, otherwise, False .TP .B Return type bool .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.util.is_staging(srv: str) -> bool Determine whether a given ACME server is a known test / staging server. .INDENT 7.0 .TP .B Parameters \fBsrv\fP (\fIstr\fP) \-\- the URI for the ACME server .TP .B Returns True iff srv is a known test / staging server .TP .B Rtype bool .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.util.atexit_register(func: Callable, *args: Any, **kwargs: Any) -> None Sets func to be called before the program exits. .sp Special care is taken to ensure func is only called when the process that first imports this module exits rather than any child processes. .INDENT 7.0 .TP .B Parameters \fBfunc\fP (\fIfunction\fP) \-\- function to be called in case of an error .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.util.parse_loose_version(version_string: str) -> List[int | str] Parses a version string into its components. This code and the returned tuple is based on the now deprecated distutils.version.LooseVersion class from the Python standard library. Two LooseVersion classes and two lists as returned by this function should compare in the same way. See \fI\%https://github.com/python/cpython/blob/v3.10.0/Lib/distutils/version.py#L205\-L347\fP\&. :param str version_string: version string :returns: list of parsed version string components :rtype: list .UNINDENT .INDENT 0.0 .IP \(bu 2 \fI\%Index\fP .IP \(bu 2 \fI\%Module Index\fP .IP \(bu 2 \fI\%Search Page\fP .UNINDENT .SH AUTHOR Certbot .SH COPYRIGHT 2014-2024 - The Certbot software and documentation are licensed under the Apache 2.0 license as described at https://eff.org/cb-license. .\" Generated by docutils manpage writer. .