'\" 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" "Mar 13, 2025" "3.3" "Certbot" .SH NAME certbot \- Certbot Documentation .SH INTRODUCTION .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 To get started quickly, use the \X'tty: link https://certbot.eff.org'\fI\%interactive installation guide\fP\X'tty: link'\&. .UNINDENT .UNINDENT .sp \X'tty: link https://dev.azure.com/certbot/certbot/_build?definitionId=5'\fI\%Azure Pipelines CI status\fP\X'tty: link' [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 \X'tty: link https://certbot.eff.org'\fI\%interactive guide\fP\X'tty: link'\&. It generates instructions based on your configuration settings. In most cases, you’ll need \X'tty: link https://certbot.eff.org/faq/#does-certbot-require-root-administrator-privileges'\fI\%root or administrator access\fP\X'tty: link' 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 \X'tty: link https://certbot.eff.org/docs/contributing.html'\fI\%Developer Guide\fP\X'tty: link'\&. .sp This project is governed by \X'tty: link https://www.eff.org/pages/eppcode'\fI\%EFF\(aqs Public Projects Code of Conduct\fP\X'tty: link'\&. .SS Links .sp Documentation: \X'tty: link https://certbot.eff.org/docs'\fI\%https://certbot.eff.org/docs\fP\X'tty: link' .sp Software project: \X'tty: link https://github.com/certbot/certbot'\fI\%https://github.com/certbot/certbot\fP\X'tty: link' .sp Changelog: \X'tty: link https://github.com/certbot/certbot/blob/main/certbot/CHANGELOG.md'\fI\%https://github.com/certbot/certbot/blob/main/certbot/CHANGELOG.md\fP\X'tty: link' .sp For Contributors: \X'tty: link https://certbot.eff.org/docs/contributing.html'\fI\%https://certbot.eff.org/docs/contributing.html\fP\X'tty: link' .sp For Users: \X'tty: link https://certbot.eff.org/docs/using.html'\fI\%https://certbot.eff.org/docs/using.html\fP\X'tty: link' .sp Main Website: \X'tty: link https://certbot.eff.org'\fI\%https://certbot.eff.org\fP\X'tty: link' .sp Let\(aqs Encrypt Website: \X'tty: link https://letsencrypt.org'\fI\%https://letsencrypt.org\fP\X'tty: link' .sp Community: \X'tty: link https://community.letsencrypt.org'\fI\%https://community.letsencrypt.org\fP\X'tty: link' .sp ACME spec: \X'tty: link https://tools.ietf.org/html/rfc8555'\fI\%RFC 8555\fP\X'tty: link' .sp ACME working area in github (archived): \X'tty: link https://github.com/ietf-wg-acme/acme'\fI\%https://github.com/ietf\-wg\-acme/acme\fP\X'tty: link' .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 \X'tty: link https://certbot.eff.org/instructions'\fI\%https://certbot.eff.org/instructions\fP\X'tty: link'\&. .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 \X'tty: link https://certbot.eff.org/instructions'\fI\%https://certbot.eff.org/instructions\fP\X'tty: link' 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 \X'tty: link https://docker.com'\fI\%Docker\fP\X'tty: link' 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 \X'tty: link https://certbot.eff.org/instructions'\fI\%certbot.eff.org\fP\X'tty: link'\&. 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 \X'tty: link https://certbot.eff.org/instructions'\fI\%certbot.eff.org\fP\X'tty: link', 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, \X'tty: link https://docs.docker.com/engine/installation/'\fI\%install Docker\fP\X'tty: link', 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 \X'tty: link https://hub.docker.com/u/certbot'\fI\%https://hub.docker.com/u/certbot\fP\X'tty: link' 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 \X'tty: link https://certbot.eff.org/instructions'\fI\%https://certbot.eff.org/instructions\fP\X'tty: link' 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 box 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{ \X'tty: link https://datatracker.ietf.org/doc/html/rfc8555#section-8.3'\fI\%http\-01\fP\X'tty: link' (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{ \X'tty: link https://datatracker.ietf.org/doc/html/rfc8555#section-8.3'\fI\%http\-01\fP\X'tty: link' (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{ \X'tty: link https://datatracker.ietf.org/doc/html/rfc8555#section-8.3'\fI\%http\-01\fP\X'tty: link' (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{ \X'tty: link https://datatracker.ietf.org/doc/html/rfc8555#section-8.3'\fI\%http\-01\fP\X'tty: link' (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{ \X'tty: link https://datatracker.ietf.org/doc/html/rfc8555#section-8.4'\fI\%dns\-01\fP\X'tty: link' (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{ \X'tty: link https://datatracker.ietf.org/doc/html/rfc8555#section-8.3'\fI\%http\-01\fP\X'tty: link' (80) or \X'tty: link https://datatracker.ietf.org/doc/html/rfc8555#section-8.4'\fI\%dns\-01\fP\X'tty: link' (53) T} .TE .sp Under the hood, plugins use one of several ACME protocol \X'tty: link https://datatracker.ietf.org/doc/html/rfc8555#section-8'\fI\%challenges\fP\X'tty: link' to prove you control a domain. The options are \X'tty: link https://datatracker.ietf.org/doc/html/rfc8555#section-8.3'\fI\%http\-01\fP\X'tty: link' (which uses port 80) and \X'tty: link https://datatracker.ietf.org/doc/html/rfc8555#section-8.4'\fI\%dns\-01\fP\X'tty: link' (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 \X'tty: link https://github.com/certbot/certbot/blob/main/certbot-apache/certbot_apache/_internal/entrypoint.py'\fI\%supports\fP\X'tty: link' 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 \X'tty: link https://certbot.eff.org'\fI\%https://certbot.eff.org\fP\X'tty: link' 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 \X'tty: link https://certbot-dns-cloudflare.readthedocs.io'\fI\%certbot\-dns\-cloudflare\fP\X'tty: link' .IP \(bu 2 \X'tty: link https://certbot-dns-digitalocean.readthedocs.io'\fI\%certbot\-dns\-digitalocean\fP\X'tty: link' .IP \(bu 2 \X'tty: link https://certbot-dns-dnsimple.readthedocs.io'\fI\%certbot\-dns\-dnsimple\fP\X'tty: link' .IP \(bu 2 \X'tty: link https://certbot-dns-dnsmadeeasy.readthedocs.io'\fI\%certbot\-dns\-dnsmadeeasy\fP\X'tty: link' .IP \(bu 2 \X'tty: link https://certbot-dns-gehirn.readthedocs.io'\fI\%certbot\-dns\-gehirn\fP\X'tty: link' .IP \(bu 2 \X'tty: link https://certbot-dns-google.readthedocs.io'\fI\%certbot\-dns\-google\fP\X'tty: link' .IP \(bu 2 \X'tty: link https://certbot-dns-linode.readthedocs.io'\fI\%certbot\-dns\-linode\fP\X'tty: link' .IP \(bu 2 \X'tty: link https://certbot-dns-luadns.readthedocs.io'\fI\%certbot\-dns\-luadns\fP\X'tty: link' .IP \(bu 2 \X'tty: link https://certbot-dns-nsone.readthedocs.io'\fI\%certbot\-dns\-nsone\fP\X'tty: link' .IP \(bu 2 \X'tty: link https://certbot-dns-ovh.readthedocs.io'\fI\%certbot\-dns\-ovh\fP\X'tty: link' .IP \(bu 2 \X'tty: link https://certbot-dns-rfc2136.readthedocs.io'\fI\%certbot\-dns\-rfc2136\fP\X'tty: link' .IP \(bu 2 \X'tty: link https://certbot-dns-route53.readthedocs.io'\fI\%certbot\-dns\-route53\fP\X'tty: link' .IP \(bu 2 \X'tty: link https://certbot-dns-sakuracloud.readthedocs.io'\fI\%certbot\-dns\-sakuracloud\fP\X'tty: link' .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 box center; l|l|l|l. T{ Plugin T} T{ Auth T} T{ Inst T} T{ Notes T} _ T{ \X'tty: link https://github.com/greenhost/certbot-haproxy'\fI\%haproxy\fP\X'tty: link' T} T{ Y T} T{ Y T} T{ Integration with the HAProxy load balancer T} _ T{ \X'tty: link https://github.com/dlapiduz/letsencrypt-s3front'\fI\%s3front\fP\X'tty: link' T} T{ Y T} T{ Y T} T{ Integration with Amazon CloudFront distribution of S3 buckets T} _ T{ \X'tty: link https://github.com/obynio/certbot-plugin-gandi'\fI\%gandi\fP\X'tty: link' T} T{ Y T} T{ N T} T{ Obtain certificates via the Gandi LiveDNS API T} _ T{ \X'tty: link https://git.sesse.net/?p=letsencrypt-varnish-plugin'\fI\%varnish\fP\X'tty: link' T} T{ Y T} T{ N T} T{ Obtain certificates via a Varnish server T} _ T{ \X'tty: link https://github.com/EnigmaBridge/certbot-external-auth'\fI\%external\-auth\fP\X'tty: link' T} T{ Y T} T{ Y T} T{ A plugin for convenient scripting T} _ T{ \X'tty: link https://github.com/kharkevich/letsencrypt-pritunl'\fI\%pritunl\fP\X'tty: link' T} T{ N T} T{ Y T} T{ Install certificates in pritunl distributed OpenVPN servers T} _ T{ \X'tty: link https://github.com/kharkevich/letsencrypt-proxmox'\fI\%proxmox\fP\X'tty: link' T} T{ N T} T{ Y T} T{ Install certificates in Proxmox Virtualization servers T} _ T{ \X'tty: link https://github.com/siilike/certbot-dns-standalone'\fI\%dns\-standalone\fP\X'tty: link' T} T{ Y T} T{ N T} T{ Obtain certificates via an integrated DNS server T} _ T{ \X'tty: link https://github.com/m42e/certbot-dns-ispconfig'\fI\%dns\-ispconfig\fP\X'tty: link' T} T{ Y T} T{ N T} T{ DNS Authentication using ISPConfig as DNS server T} _ T{ \X'tty: link https://github.com/inventage/certbot-dns-cloudns'\fI\%dns\-cloudns\fP\X'tty: link' T} T{ Y T} T{ N T} T{ DNS Authentication using ClouDNS API T} _ T{ \X'tty: link https://github.com/vshosting/certbot-dns-clouddns'\fI\%dns\-clouddns\fP\X'tty: link' T} T{ Y T} T{ N T} T{ DNS Authentication using CloudDNS API T} _ T{ \X'tty: link https://github.com/noi/certbot-dns-lightsail'\fI\%dns\-lightsail\fP\X'tty: link' T} T{ Y T} T{ N T} T{ DNS Authentication using Amazon Lightsail DNS API T} _ T{ \X'tty: link https://github.com/oGGy990/certbot-dns-inwx/'\fI\%dns\-inwx\fP\X'tty: link' T} T{ Y T} T{ Y T} T{ DNS Authentication for INWX through the XML API T} _ T{ \X'tty: link https://github.com/binkhq/certbot-dns-azure'\fI\%dns\-azure\fP\X'tty: link' T} T{ Y T} T{ N T} T{ DNS Authentication using Azure DNS T} _ T{ \X'tty: link https://github.com/miigotu/certbot-dns-godaddy'\fI\%dns\-godaddy\fP\X'tty: link' T} T{ Y T} T{ N T} T{ DNS Authentication using Godaddy DNS T} _ T{ \X'tty: link https://github.com/PykupeJIbc/certbot-dns-yandexcloud'\fI\%dns\-yandexcloud\fP\X'tty: link' T} T{ Y T} T{ N T} T{ DNS Authentication using Yandex Cloud DNS T} _ T{ \X'tty: link https://github.com/mwt/certbot-dns-bunny'\fI\%dns\-bunny\fP\X'tty: link' T} T{ Y T} T{ N T} T{ DNS Authentication using BunnyDNS T} _ T{ \X'tty: link https://github.com/chaptergy/certbot-dns-njalla'\fI\%njalla\fP\X'tty: link' T} T{ Y T} T{ N T} T{ DNS Authentication for njalla T} _ T{ \X'tty: link https://github.com/infinityofspace/certbot_dns_duckdns'\fI\%DuckDNS\fP\X'tty: link' T} T{ Y T} T{ N T} T{ DNS Authentication for DuckDNS T} _ T{ \X'tty: link https://github.com/infinityofspace/certbot_dns_porkbun'\fI\%Porkbun\fP\X'tty: link' T} T{ Y T} T{ N T} T{ DNS Authentication for Porkbun T} _ T{ \X'tty: link https://github.com/Infomaniak/certbot-dns-infomaniak'\fI\%Infomaniak\fP\X'tty: link' T} T{ Y T} T{ N T} T{ DNS Authentication using Infomaniak Domains API T} _ T{ \X'tty: link https://github.com/alexzorin/certbot-dns-multi'\fI\%dns\-multi\fP\X'tty: link' T} T{ Y T} T{ N T} T{ DNS authentication of 100+ providers using go\-acme/lego T} _ T{ \X'tty: link https://github.com/stayallive/certbot-dns-dnsmanager'\fI\%dns\-dnsmanager\fP\X'tty: link' T} T{ Y T} T{ N T} T{ DNS Authentication for dnsmanager.io T} _ T{ \X'tty: link https://github.com/alexzorin/certbot-standalone-nfq'\fI\%standalone\-nfq\fP\X'tty: link' T} T{ Y T} T{ N T} T{ HTTP Authentication that works with any webserver (Linux only) T} _ T{ \X'tty: link https://gitlab.com/charlyhong/certbot-dns-solidserver'\fI\%dns\-solidserver\fP\X'tty: link' T} T{ Y T} T{ N T} T{ DNS Authentication using SOLIDserver (EfficientIP) T} _ T{ \X'tty: link https://github.com/stackitcloud/certbot-dns-stackit'\fI\%dns\-stackit\fP\X'tty: link' T} T{ Y T} T{ N T} T{ DNS Authentication using STACKIT DNS T} _ T{ \X'tty: link https://github.com/ionos-cloud/certbot-dns-ionos-cloud'\fI\%dns\-ionos\fP\X'tty: link' T} T{ Y T} T{ N T} T{ DNS Authentication using IONOS Cloud DNS T} _ T{ \X'tty: link https://github.com/mijnhost/certbot-dns-mijn-host'\fI\%dns\-mijn\-host\fP\X'tty: link' T} T{ Y T} T{ N T} T{ DNS Authentication using mijn.host DNS T} _ T{ \X'tty: link https://github.com/kea/certbot-nginx-unit'\fI\%nginx\-unit\fP\X'tty: link' T} T{ Y T} T{ Y T} T{ Automates obtaining and installing a certificate with Nginx Unit 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 \X'tty: link https://letsencrypt.org/docs/rate-limits/'\fI\%here\fP\X'tty: link'\&. .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. These hooks are run in alphabetical order. (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 Prior to certbot 3.2.0, hooks in directories were only run when certificates were renewed with the \fBrenew\fP subcommand, but as of 3.2.0, they are run for any subcommand. .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 \X'tty: link https://certbot.eff.org/instructions'\fI\%https://certbot.eff.org/instructions\fP\X'tty: link'\&. 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 \X'tty: link https://certbot.eff.org/instructions'\fI\%https://certbot.eff.org/instructions\fP\X'tty: link' 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 \X'tty: link https://httpd.apache.org/docs/2.4/mod/mod_ssl.html#sslcertificatekeyfile'\fI\%SSLCertificateKeyFile\fP\X'tty: link', and Nginx for \X'tty: link https://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_certificate_key'\fI\%ssl_certificate_key\fP\X'tty: link'\&. .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 \X'tty: link https://httpd.apache.org/docs/2.4/mod/mod_ssl.html#sslcertificatefile'\fI\%SSLCertificateFile\fP\X'tty: link', and what Nginx needs for \X'tty: link https://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_certificate'\fI\%ssl_certificate\fP\X'tty: link'\&. .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, \X'tty: link https://whatsmychaincert.com/'\fI\%some of the time\fP\X'tty: link'\&. .sp Apache < 2.4.8 needs these for \X'tty: link https://httpd.apache.org/docs/2.4/mod/mod_ssl.html#sslcertificatefile'\fI\%SSLCertificateFile\fP\X'tty: link'\&. and \X'tty: link https://httpd.apache.org/docs/2.4/mod/mod_ssl.html#sslcertificatechainfile'\fI\%SSLCertificateChainFile\fP\X'tty: link', respectively. .sp If you\(aqre using OCSP stapling with Nginx >= 1.3.7, \fBchain.pem\fP should be provided as the \X'tty: link https://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_trusted_certificate'\fI\%ssl_trusted_certificate\fP\X'tty: link' 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 \X'tty: link https://acme-v02.api.letsencrypt.org/directory'\fI\%https://acme\-v02.api.letsencrypt.org/directory\fP\X'tty: link'\&. 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 \X'tty: link https://requests.readthedocs.io/en/latest/user/advanced/#ssl-cert-verification'\fI\%REQUESTS_CA_BUNDLE\fP\X'tty: link' 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 80 # 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 optional arguments: \-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/3.3.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: False) \-\-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: False) \-\-staple\-ocsp Enables OCSP Stapling. A valid OCSP response is stapled to the certificate that the server offers during TLS. (default: False) \-\-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. (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: Ask) \-\-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: Ask) register: Options for account registration \-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: Ask) \-\-no\-eff\-email Don\(aqt share your e\-mail address with EFF (default: Ask) 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 separate 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 \X'tty: link https://community.letsencrypt.org'\fI\%Community Forum\fP\X'tty: link'\&. .sp If you find a bug in the software, please do report it in our \X'tty: link https://github.com/certbot/certbot/issues'\fI\%issue tracker\fP\X'tty: link'\&. 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 .IP \(bu 2 \fI\%macOS suggestions\fP .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. .sp If you\(aqre using macOS, it is recommended to first check out the \fI\%macOS suggestions\fP section before continuing with the installation instructions below. .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 # NB1: If you also run \(gabrew install python\(ga you don\(aqt need the ~/lib # directory created below, however, without this directory and symlinks # to augeas, Certbot\(aqs Apache plugin won\(aqt work if you use Python # installed from other sources such as pyenv or the version provided by # Apple. # NB2: Some of our developer scripts expect GNU coreutils be first in your # PATH. The commands below set this up for bash and zsh, but your # instructions may be slightly different if you use an alternate shell. brew install augeas coreutils gnu\-sed mkdir ~/lib BREW_PREFIX=$(brew \-\-prefix) ln \-s \(dq$BREW_PREFIX\(dq/lib/libaugeas* ~/lib RC_LINE=\(dqexport PATH=\e\(dq$BREW_PREFIX/opt/coreutils/libexec/gnubin:\(dq RC_LINE+=\(dq$BREW_PREFIX/opt/gnu\-sed/libexec/gnubin:\e$PATH\e\(dq\(dq echo \(dq$RC_LINE\(dq >> ~/.bashrc # for bash echo \(dq$RC_LINE\(dq >> ~/.zshrc # for zsh .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 \X'tty: link https://cryptography.io/en/latest/installation.html#building-cryptography-on-linux'\fI\%cryptography project\(aqs site\fP\X'tty: link' 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 python3 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 \X'tty: link https://virtualenv.pypa.io'\fI\%virtualenv docs\fP\X'tty: link'\&. .SS Find issues to work on .sp You can find the open issues in the \X'tty: link https://github.com/certbot/certbot/issues'\fI\%github issue tracker\fP\X'tty: link'\&. 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 .SS Running automated unit tests .sp To run all unittests, mypy, and lint: .INDENT 0.0 .INDENT 3.5 .sp .EX tox .EE .UNINDENT .UNINDENT .sp If you\(aqre working on a specific test and would like to run just that one: .INDENT 0.0 .INDENT 3.5 .sp .EX pytest acme/acme/_internal/tests/messages_test.py # Use the test file you\(aqre working on .EE .UNINDENT .UNINDENT .sp To run a specific test case within a file: .INDENT 0.0 .INDENT 3.5 .sp .EX pytest acme/acme/_internal/tests/messages_test.py \-k test_to_partial_json .EE .UNINDENT .UNINDENT .sp For debugging, we recommend putting \fBimport ipdb; ipdb.set_trace()\fP statements inside the source code, which will require adding the \fB\-s\fP flag to \fBpytest\fP invocations. .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 installed and working. .sp The tox environment \fBintegration\fP will setup \X'tty: link https://github.com/letsencrypt/pebble'\fI\%Pebble\fP\X'tty: link', 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 run \-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 \X'tty: link https://github.com/letsencrypt/pebble'\fI\%Pebble\fP\X'tty: link' 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 \fBpython3 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 python3 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 .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 \X'tty: link https://github.com/certbot/certbot/blob/main/certbot/certbot/interfaces.py'\fI\%interfaces.py\fP\X'tty: link' and \X'tty: link https://github.com/certbot/certbot/blob/main/certbot/certbot/plugins/common.py#L45'\fI\%plugins/common.py\fP\X'tty: link'\&. .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 \X'tty: link https://acme-python.readthedocs.io/en/latest/api/challenges.html#module-acme.challenges'\fI\%acme.challenges\fP\X'tty: link'\&. 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 \X'tty: link https://github.com/certbot/certbot/issues/6464'\fI\%#6464\fP\X'tty: link', \X'tty: link https://github.com/certbot/certbot/issues/6503'\fI\%#6503\fP\X'tty: link', and \X'tty: link https://github.com/certbot/certbot/issues/6504'\fI\%#6504\fP\X'tty: link' first. .sp In the meantime, you\(aqre welcome to release it as a third\-party plugin. See \X'tty: link https://github.com/m42e/certbot-dns-ispconfig'\fI\%certbot\-dns\-ispconfig\fP\X'tty: link' for one example of that. .UNINDENT .UNINDENT .sp Certbot client supports dynamic discovery of plugins through the \X'tty: link https://importlib-metadata.readthedocs.io/en/latest/using.html#entry-points'\fI\%importlib.metadata entry points\fP\X'tty: link' 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 \X'tty: link https://snapcraft.io/docs/content-interface'\fI\%snap content interface\fP\X'tty: link' 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.12/site\-packages/\fP in the plugin snap. This location is the default when using the \fBcore24\fP \X'tty: link https://snapcraft.io/docs/base-snaps'\fI\%base snap\fP\X'tty: link' and the \X'tty: link https://snapcraft.io/docs/python-plugin'\fI\%python snapcraft plugin\fP\X'tty: link'\&. .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 \X'tty: link https://github.com/certbot/certbot/blob/main/tools/snap/generate_dnsplugins_snapcraft.sh'\fI\%https://github.com/certbot/certbot/blob/main/tools/snap/generate_dnsplugins_snapcraft.sh\fP\X'tty: link'\&. .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 \X'tty: link https://www.python.org/dev/peps/pep-0008'\fI\%PEP 8 \- Style Guide for Python Code\fP\X'tty: link'\&. .IP 3. 3 Follow the \X'tty: link https://google.github.io/styleguide/pyguide.html'\fI\%Google Python Style Guide\fP\X'tty: link', with the exception that we use \X'tty: link https://www.sphinx-doc.org/'\fI\%Sphinx\-style\fP\X'tty: link' 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 \X'tty: link https://editorconfig.org/'\fI\%editorconfig\fP\X'tty: link' 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 \X'tty: link https://mypy.readthedocs.io'\fI\%mypy\fP\X'tty: link' 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 \X'tty: link https://blog.zulip.org/2016/10/13/static-types-in-python-oh-mypy/'\fI\%great guide\fP\X'tty: link' 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 run \-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 run \-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 run \-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 \X'tty: link https://github.com/blog/2141-squash-your-commits'\fI\%squash merges\fP\X'tty: link' 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 \X'tty: link https://opensource.eff.org/signup_user_complete/?id=6iqur37ucfrctfswrs14iscobw'\fI\%EFF Open Source Contributor Chat Platform\fP\X'tty: link'\&. 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 \X'tty: link https://www.eff.org/policy'\fI\%Privacy Policy\fP\X'tty: link', to further the mission of EFF, including hosting and moderating the discussions on this platform. .sp Use of EFFOSCCP is subject to the \X'tty: link https://www.eff.org/pages/eppcode'\fI\%EFF Code of Conduct\fP\X'tty: link'\&. 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 \X'tty: link https://github.com/certbot/certbot/tree/main/tools/snap'\fI\%https://github.com/certbot/certbot/tree/main/tools/snap\fP\X'tty: link'\&. .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, 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 \X'tty: link https://python-poetry.org/docs/pyproject/'\fI\%https://python\-poetry.org/docs/pyproject/\fP\X'tty: link' and how dependencies are specified in this file is further described at \X'tty: link https://python-poetry.org/docs/dependency-specification/'\fI\%https://python\-poetry.org/docs/dependency\-specification/\fP\X'tty: link'\&. .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 When choosing dependency versions, we should choose whatever minimum versions simplify development of Certbot and our own distribution methods such as snaps, pip, and docker. Since these approaches have full access to PyPI, it\(aqs OK if the required packages declared in \fBsetup.py\fP are quite new. .sp If this approach to development creates significant trouble for some of our users, we can revisit this decision and weigh their trouble against the difficulties involved in maintaining support for a wider range of package versions. When doing this, we should also be sure to consider the feasibility of users getting access to these newer packages on their system rather than changing our own approach here. Their OS distribution may be able to package it, especially in an alternate repository and/or for a different version of Python to help avoid conflicts with other packages on their system. .SS macOS suggestions .sp If you\(aqre developing on macOS, before \fI\%setting up your Certbot development environment\fP, it is recommended you perform the following steps. None of this is required, but it is the approach used by all/most of the current Certbot developers on macOS as of writing this: .INDENT 0.0 .IP 0. 4 Install \X'tty: link https://brew.sh/'\fI\%Homebrew\fP\X'tty: link'\&. It is the most popular package manager on macOS by a wide margin and works well enough. .IP 1. 4 Install \X'tty: link https://github.com/pyenv/pyenv'\fI\%pyenv\fP\X'tty: link', ideally through Homebrew by running \fBbrew install pyenv\fP\&. Using Homebrew\(aqs Python for Certbot development is annoying because it regularly updates and every time it does it breaks your virtual environments. Using Python from \fBpyenv\fP avoids this problem and gives you easy access to all versions of Python. .IP 2. 4 If you\(aqre using \fBpyenv\fP, make sure you\(aqve set up your shell for it by following instructions like \X'tty: link https://github.com/pyenv/pyenv?tab=readme-ov-file#set-up-your-shell-environment-for-pyenv'\fI\%https://github.com/pyenv/pyenv?tab=readme\-ov\-file#set\-up\-your\-shell\-environment\-for\-pyenv\fP\X'tty: link'\&. .IP 3. 4 Configure \fBgit\fP to ignore the \fB\&.DS_Store\fP files that are created by macOS\(aqs file manager Finder by running something like: .UNINDENT .INDENT 0.0 .INDENT 3.5 .sp .EX mkdir \-p ~/.config/git echo \(aq.DS_Store\(aq >> ~/.config/git/ignore .EE .UNINDENT .UNINDENT .SH PACKAGING GUIDE .SS Releases .sp We release packages and upload them to PyPI (wheels and source tarballs). .INDENT 0.0 .IP \(bu 2 \X'tty: link https://pypi.org/project/acme/'\fI\%https://pypi.org/project/acme/\fP\X'tty: link' .IP \(bu 2 \X'tty: link https://pypi.org/project/certbot/'\fI\%https://pypi.org/project/certbot/\fP\X'tty: link' .IP \(bu 2 \X'tty: link https://pypi.org/project/certbot-apache/'\fI\%https://pypi.org/project/certbot\-apache/\fP\X'tty: link' .IP \(bu 2 \X'tty: link https://pypi.org/project/certbot-nginx/'\fI\%https://pypi.org/project/certbot\-nginx/\fP\X'tty: link' .IP \(bu 2 \X'tty: link https://pypi.org/project/certbot-dns-cloudflare/'\fI\%https://pypi.org/project/certbot\-dns\-cloudflare/\fP\X'tty: link' .IP \(bu 2 \X'tty: link https://pypi.org/project/certbot-dns-digitalocean/'\fI\%https://pypi.org/project/certbot\-dns\-digitalocean/\fP\X'tty: link' .IP \(bu 2 \X'tty: link https://pypi.org/project/certbot-dns-dnsimple/'\fI\%https://pypi.org/project/certbot\-dns\-dnsimple/\fP\X'tty: link' .IP \(bu 2 \X'tty: link https://pypi.org/project/certbot-dns-dnsmadeeasy/'\fI\%https://pypi.org/project/certbot\-dns\-dnsmadeeasy/\fP\X'tty: link' .IP \(bu 2 \X'tty: link https://pypi.org/project/certbot-dns-google/'\fI\%https://pypi.org/project/certbot\-dns\-google/\fP\X'tty: link' .IP \(bu 2 \X'tty: link https://pypi.org/project/certbot-dns-linode/'\fI\%https://pypi.org/project/certbot\-dns\-linode/\fP\X'tty: link' .IP \(bu 2 \X'tty: link https://pypi.org/project/certbot-dns-luadns/'\fI\%https://pypi.org/project/certbot\-dns\-luadns/\fP\X'tty: link' .IP \(bu 2 \X'tty: link https://pypi.org/project/certbot-dns-nsone/'\fI\%https://pypi.org/project/certbot\-dns\-nsone/\fP\X'tty: link' .IP \(bu 2 \X'tty: link https://pypi.org/project/certbot-dns-ovh/'\fI\%https://pypi.org/project/certbot\-dns\-ovh/\fP\X'tty: link' .IP \(bu 2 \X'tty: link https://pypi.org/project/certbot-dns-rfc2136/'\fI\%https://pypi.org/project/certbot\-dns\-rfc2136/\fP\X'tty: link' .IP \(bu 2 \X'tty: link https://pypi.org/project/certbot-dns-route53/'\fI\%https://pypi.org/project/certbot\-dns\-route53/\fP\X'tty: link' .UNINDENT .sp The following scripts are used in the process: .INDENT 0.0 .IP \(bu 2 \X'tty: link https://github.com/certbot/certbot/blob/main/tools/release.sh'\fI\%https://github.com/certbot/certbot/blob/main/tools/release.sh\fP\X'tty: link' .UNINDENT .sp We use git tags to identify releases, using \X'tty: link https://semver.org/'\fI\%Semantic Versioning\fP\X'tty: link'\&. 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 \X'tty: link https://dl.eff.org/certbot.pub'\fI\%https://dl.eff.org/certbot.pub\fP\X'tty: link'\&. .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 \fBmain\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 \X'tty: link https://acme-python.readthedocs.io/'\fI\%acme\fP\X'tty: link', Certbot, and \fI\%non\-third party plugins\fP follow \X'tty: link https://semver.org/'\fI\%Semantic Versioning\fP\X'tty: link' 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: \X'tty: link https://certbot.eff.org/docs'\fI\%https://certbot.eff.org/docs\fP\X'tty: link' .sp Software project: \X'tty: link https://github.com/certbot/certbot'\fI\%https://github.com/certbot/certbot\fP\X'tty: link' .sp Changelog: \X'tty: link https://github.com/certbot/certbot/blob/main/certbot/CHANGELOG.md'\fI\%https://github.com/certbot/certbot/blob/main/certbot/CHANGELOG.md\fP\X'tty: link' .sp For Contributors: \X'tty: link https://certbot.eff.org/docs/contributing.html'\fI\%https://certbot.eff.org/docs/contributing.html\fP\X'tty: link' .sp For Users: \X'tty: link https://certbot.eff.org/docs/using.html'\fI\%https://certbot.eff.org/docs/using.html\fP\X'tty: link' .sp Main Website: \X'tty: link https://certbot.eff.org'\fI\%https://certbot.eff.org\fP\X'tty: link' .sp Let\(aqs Encrypt Website: \X'tty: link https://letsencrypt.org'\fI\%https://letsencrypt.org\fP\X'tty: link' .sp Community: \X'tty: link https://community.letsencrypt.org'\fI\%https://community.letsencrypt.org\fP\X'tty: link' .sp ACME spec: \X'tty: link https://tools.ietf.org/html/rfc8555'\fI\%RFC 8555\fP\X'tty: link' .sp ACME working area in github (archived): \X'tty: link https://github.com/ietf-wg-acme/acme'\fI\%https://github.com/ietf\-wg\-acme/acme\fP\X'tty: link' .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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', mode: \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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 \X'tty: link https://github.com/certbot/certbot/issues/6356'\fI\%https://github.com/certbot/certbot/issues/6356\fP\X'tty: link' 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- Path of the file .IP \(bu 2 \fBmode\fP (\X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link') \-\- POSIX mode to apply .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.compat.filesystem.umask(mask: \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' 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 (\X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link') \-\- The user file\-creation mode mask to apply. .TP .B Return type \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' .TP .B Returns The previous umask value. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.compat.filesystem.temp_umask(mask: \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.Generator'\fI\%Generator\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link', \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link', \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link'] 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 (\X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link') \-\- 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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', dst: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', mode: \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link', copy_user: \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link', copy_group: \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- Path of the source file .IP \(bu 2 \fBdst\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- Path of the destination file .IP \(bu 2 \fBmode\fP (\X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link') \-\- Permission mode to apply on the destination file .IP \(bu 2 \fBcopy_user\fP (\X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link') \-\- Copy user if \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' .IP \(bu 2 \fBcopy_group\fP (\X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link') \-\- Copy group if \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' on Linux (has no effect on Windows) .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.compat.filesystem.copy_ownership_and_mode(src: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', dst: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', copy_user: \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' = True, copy_group: \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' = True) -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- Path of the source file .IP \(bu 2 \fBdst\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- Path of the destination file .IP \(bu 2 \fBcopy_user\fP (\X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link') \-\- Copy user if \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' .IP \(bu 2 \fBcopy_group\fP (\X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link') \-\- Copy group if \X'tty: link https://docs.python.org/3/library/constants.html#True'\fI\%True\fP\X'tty: link' on Linux (has no effect on Windows) .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.compat.filesystem.check_mode(file_path: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', mode: \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- Path of the file .IP \(bu 2 \fBmode\fP (\X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link') \-\- POSIX mode to test .UNINDENT .TP .B Return type \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' .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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' Check if given file is owned by current user. .INDENT 7.0 .TP .B Parameters \fBfile_path\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- File path to check .TP .B Return type \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' .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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', mode: \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- File path to check .IP \(bu 2 \fBmode\fP (\X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link') \-\- POSIX mode to check .UNINDENT .TP .B Return type \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' .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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', flags: \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link', mode: \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' = 511) -> \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- The file path to open .IP \(bu 2 \fBflags\fP (\X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link') \-\- Flags to apply on file while opened .IP \(bu 2 \fBmode\fP (\X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link') \-\- 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 \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' .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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', mode: \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' = 511) -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- The file path to open .IP \(bu 2 \fBmode\fP (\X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link') \-\- 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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', mode: \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' = 511) -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- The file path to open .IP \(bu 2 \fBmode\fP (\X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link') \-\- 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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', dst: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- The current file path. .IP \(bu 2 \fBdst\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- The new file path. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.compat.filesystem.realpath(file_path: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- The path to resolve .TP .B Returns The real path for the given path .TP .B Return type \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.compat.filesystem.readlink(link_path: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' Return a string representing the path to which the symbolic link points. .INDENT 7.0 .TP .B Parameters \fBlink_path\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- 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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' Is path an executable file? .INDENT 7.0 .TP .B Parameters \fBpath\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- path to test .TP .B Returns True if path is an executable file .TP .B Return type \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.compat.filesystem.has_world_permissions(path: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' Check if everybody/world has any right (read/write/execute) on a file given its path. .INDENT 7.0 .TP .B Parameters \fBpath\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- path to test .TP .B Returns True if everybody/world has any right to the file .TP .B Return type \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.compat.filesystem.compute_private_key_mode(old_key: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', base_mode: \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- path to the previous private key .IP \(bu 2 \fBbase_mode\fP (\X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link') \-\- the minimum modes to apply to a private key .UNINDENT .TP .B Returns the POSIX mode to apply .TP .B Return type \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.compat.filesystem.has_same_ownership(path1: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', path2: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- path to the first file .IP \(bu 2 \fBpath2\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- path to the second file .UNINDENT .TP .B Returns True if both files have the same ownership, False otherwise .TP .B Return type \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.compat.filesystem.has_min_permissions(path: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', min_mode: \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- path to the file to check .IP \(bu 2 \fBmin_mode\fP (\X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link') \-\- the minimal permissions expected .UNINDENT .TP .B Returns True if the file matches the minimal permissions expectations, False otherwise .TP .B Return type \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' .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() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' On Windows, ensure that Console Virtual Terminal Sequences are enabled. .UNINDENT .INDENT 0.0 .TP .B certbot.compat.misc.readline_with_timeout(timeout: \X'tty: link https://docs.python.org/3/library/functions.html#float'\fI\%float\fP\X'tty: link', prompt: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' 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 (\X'tty: link https://docs.python.org/3/library/functions.html#float'\fI\%float\fP\X'tty: link') \-\- The timeout in seconds given to the user. .IP \(bu 2 \fBprompt\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- The prompt message to display to the user. .UNINDENT .TP .B Returns The first line entered by the user. .TP .B Return type \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.compat.misc.get_default_folder(folder_type: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' Return the relevant default folder for the current OS .INDENT 7.0 .TP .B Parameters \fBfolder_type\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- The type of folder to retrieve (config, work or logs) .TP .B Returns The relevant default folder. .TP .B Return type \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.compat.misc.underscores_for_unsupported_characters_in_path(path: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' 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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', shell_cmd: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', env: \X'tty: link https://docs.python.org/3/library/stdtypes.html#dict'\fI\%dict\fP\X'tty: link' | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' = None) -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.Tuple'\fI\%Tuple\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link', \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'] .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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- the user facing name of the hook being run .IP \(bu 2 \fBshell_cmd\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- shell command to execute .IP \(bu 2 \fBenv\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#dict'\fI\%dict\fP\X'tty: link') \-\- environ to pass into subprocess.run .UNINDENT .TP .B Returns \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link' (\X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' returncode, \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' stderr, \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' 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: \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' = False, **kwargs: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' Prompt for valid email address. .INDENT 7.0 .TP .B Parameters \fBinvalid\fP (\X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link') \-\- True if an invalid address was provided by the user .TP .B Returns e\-mail address .TP .B Return type \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' .TP .B Raises \fI\%errors.Error\fP \-\- if the user cancels .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.display.ops.choose_account(accounts: \X'tty: link https://docs.python.org/3/library/typing.html#typing.List'\fI\%List\fP\X'tty: link'[Account]) -> Account | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' Choose an account. .INDENT 7.0 .TP .B Parameters \fBaccounts\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#list'\fI\%list\fP\X'tty: link') \-\- Containing at least one \fBAccount\fP .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.display.ops.choose_values(values: \X'tty: link https://docs.python.org/3/library/typing.html#typing.List'\fI\%List\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'], question: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' = None) -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.List'\fI\%List\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'] 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#list'\fI\%list\fP\X'tty: link') \-\- Values to select from .IP \(bu 2 \fBquestion\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- Question to ask to user while choosing values .UNINDENT .TP .B Returns List of selected values .TP .B Return type \X'tty: link https://docs.python.org/3/library/stdtypes.html#list'\fI\%list\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.display.ops.choose_names(installer: \fI\%Installer\fP | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link', question: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' = None) -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.List'\fI\%List\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'] 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- 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 \X'tty: link https://docs.python.org/3/library/stdtypes.html#list'\fI\%list\fP\X'tty: link' of \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.display.ops.get_valid_domains(domains: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Iterable'\fI\%Iterable\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link']) -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.List'\fI\%List\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'] .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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#list'\fI\%list\fP\X'tty: link') \-\- Domain names to validate .TP .B Returns List of valid domains .TP .B Return type \X'tty: link https://docs.python.org/3/library/stdtypes.html#list'\fI\%list\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.display.ops.success_installation(domains: \X'tty: link https://docs.python.org/3/library/typing.html#typing.List'\fI\%List\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link']) -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' Display a box confirming the installation of HTTPS. .INDENT 7.0 .TP .B Parameters \fBdomains\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#list'\fI\%list\fP\X'tty: link') \-\- domain names which were enabled .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.display.ops.success_renewal(unused_domains: \X'tty: link https://docs.python.org/3/library/typing.html#typing.List'\fI\%List\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link']) -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' Display a box confirming the renewal of an existing certificate. .INDENT 7.0 .TP .B Parameters \fBdomains\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#list'\fI\%list\fP\X'tty: link') \-\- domain names which were renewed .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.display.ops.success_revocation(cert_path: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' Display a message confirming a certificate has been revoked. .INDENT 7.0 .TP .B Parameters \fBcert_path\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#list'\fI\%list\fP\X'tty: link') \-\- path to certificate which was revoked. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.display.ops.report_executed_command(command_name: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', returncode: \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link', stdout: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', stderr: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- Human\-readable description of the executed command .IP \(bu 2 \fBreturncode\fP (\X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link') \-\- The exit code of the executed command .IP \(bu 2 \fBstdout\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- The stdout output of the executed command .IP \(bu 2 \fBstderr\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- The stderr output of the executed command .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.display.ops.validated_input(validator: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Callable'\fI\%Callable\fP\X'tty: link'[[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'], \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link'], *args: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link', **kwargs: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.Tuple'\fI\%Tuple\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'] 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#list'\fI\%list\fP\X'tty: link') \-\- Arguments to be passed to \fI\%input_text\fP\&. .IP \(bu 2 \fB**kwargs\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#dict'\fI\%dict\fP\X'tty: link') \-\- Arguments to be passed to \fI\%input_text\fP\&. .UNINDENT .TP .B Returns as \fI\%input_text\fP .TP .B Return type \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.display.ops.validated_directory(validator: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Callable'\fI\%Callable\fP\X'tty: link'[[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'], \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link'], *args: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link', **kwargs: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.Tuple'\fI\%Tuple\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'] 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#list'\fI\%list\fP\X'tty: link') \-\- Arguments to be passed to \fI\%directory_select\fP\&. .IP \(bu 2 \fB**kwargs\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#dict'\fI\%dict\fP\X'tty: link') \-\- Arguments to be passed to \fI\%directory_select\fP\&. .UNINDENT .TP .B Returns as \fI\%directory_select\fP .TP .B Return type \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link' .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 \X'tty: link https://docs.python.org/3/library/logging.html#module-logging'\fI\%logging\fP\X'tty: link' 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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' Display a basic status message. .INDENT 7.0 .TP .B Parameters \fBmsg\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- message to display .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.display.util.notification(message: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', pause: \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' = True, wrap: \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' = True, force_interactive: \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' = False, decorate: \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' = True) -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' Displays a notification and waits for user acceptance. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBmessage\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- Message to display .IP \(bu 2 \fBpause\fP (\X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link') \-\- Whether or not the program should pause for the user\(aqs confirmation .IP \(bu 2 \fBwrap\fP (\X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link') \-\- Whether or not the application should wrap text .IP \(bu 2 \fBforce_interactive\fP (\X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link') \-\- True if it\(aqs safe to prompt the user because it won\(aqt cause any workflow regressions .IP \(bu 2 \fBdecorate\fP (\X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link') \-\- Whether to surround the message with a decorated frame .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.display.util.menu(message: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', choices: \X'tty: link https://docs.python.org/3/library/typing.html#typing.List'\fI\%List\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'] | \X'tty: link https://docs.python.org/3/library/typing.html#typing.List'\fI\%List\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/typing.html#typing.Tuple'\fI\%Tuple\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link']], default: \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' = None, cli_flag: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' = None, force_interactive: \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' = False) -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.Tuple'\fI\%Tuple\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link'] Display a menu. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBmessage\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- title of menu .IP \(bu 2 \fBchoices\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#list'\fI\%list\fP\X'tty: link'\fI of \fP\fItuples\fP\fI (\fP\fItag\fP\fI, \fP\fIitem\fP\fI) or \fP\X'tty: link https://docs.python.org/3/library/stdtypes.html#list'\fI\%list\fP\X'tty: link'\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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- option used to set this value with the CLI .IP \(bu 2 \fBforce_interactive\fP (\X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link') \-\- True if it\(aqs safe to prompt the user because it won\(aqt cause any workflow regressions .UNINDENT .TP .B Returns tuple of (\X'tty: link https://docs.python.org/3/library/code.html#module-code'\fI\%code\fP\X'tty: link', \fBindex\fP) where \X'tty: link https://docs.python.org/3/library/code.html#module-code'\fI\%code\fP\X'tty: link' \- str display exit code \fBindex\fP \- int index of the user\(aqs selection .TP .B Return type \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.display.util.input_text(message: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', default: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' = None, cli_flag: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' = None, force_interactive: \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' = False) -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.Tuple'\fI\%Tuple\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'] Accept input from the user. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBmessage\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- option used to set this value with the CLI .IP \(bu 2 \fBforce_interactive\fP (\X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link') \-\- True if it\(aqs safe to prompt the user because it won\(aqt cause any workflow regressions .UNINDENT .TP .B Returns tuple of (\X'tty: link https://docs.python.org/3/library/code.html#module-code'\fI\%code\fP\X'tty: link', \X'tty: link https://docs.python.org/3/library/functions.html#input'\fI\%input\fP\X'tty: link') where \X'tty: link https://docs.python.org/3/library/code.html#module-code'\fI\%code\fP\X'tty: link' \- str display exit code \X'tty: link https://docs.python.org/3/library/functions.html#input'\fI\%input\fP\X'tty: link' \- str of the user\(aqs input .TP .B Return type \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.display.util.yesno(message: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', yes_label: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' = \(aqYes\(aq, no_label: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' = \(aqNo\(aq, default: \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' = None, cli_flag: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' = None, force_interactive: \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' = False) -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- question for the user .IP \(bu 2 \fByes_label\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- Label of the \(dqYes\(dq parameter .IP \(bu 2 \fBno_label\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- option used to set this value with the CLI .IP \(bu 2 \fBforce_interactive\fP (\X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link') \-\- 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 \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.display.util.checklist(message: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', tags: \X'tty: link https://docs.python.org/3/library/typing.html#typing.List'\fI\%List\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'], default: \X'tty: link https://docs.python.org/3/library/typing.html#typing.List'\fI\%List\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'] | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' = None, cli_flag: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' = None, force_interactive: \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' = False) -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.Tuple'\fI\%Tuple\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', \X'tty: link https://docs.python.org/3/library/typing.html#typing.List'\fI\%List\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link']] Display a checklist. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBmessage\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- Message to display to user .IP \(bu 2 \fBtags\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#list'\fI\%list\fP\X'tty: link') \-\- \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- option used to set this value with the CLI .IP \(bu 2 \fBforce_interactive\fP (\X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link') \-\- True if it\(aqs safe to prompt the user because it won\(aqt cause any workflow regressions .UNINDENT .TP .B Returns tuple of (\X'tty: link https://docs.python.org/3/library/code.html#module-code'\fI\%code\fP\X'tty: link', \fBtags\fP) where \X'tty: link https://docs.python.org/3/library/code.html#module-code'\fI\%code\fP\X'tty: link' \- str display exit code \fBtags\fP \- list of selected tags .TP .B Return type \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.display.util.directory_select(message: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', default: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' = None, cli_flag: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' = None, force_interactive: \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' = False) -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.Tuple'\fI\%Tuple\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'] Display a directory selection screen. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBmessage\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- option used to set this value with the CLI .IP \(bu 2 \fBforce_interactive\fP (\X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link') \-\- 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 (\X'tty: link https://docs.python.org/3/library/code.html#module-code'\fI\%code\fP\X'tty: link', \X'tty: link https://docs.python.org/3/library/string.html#module-string'\fI\%string\fP\X'tty: link') where \X'tty: link https://docs.python.org/3/library/code.html#module-code'\fI\%code\fP\X'tty: link' \- display exit code \X'tty: link https://docs.python.org/3/library/string.html#module-string'\fI\%string\fP\X'tty: link' \- input entered by the user .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.display.util.assert_valid_call(prompt: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', default: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', cli_flag: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', force_interactive: \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' Verify that provided arguments is a valid display call. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBprompt\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- prompt for the user .IP \(bu 2 \fBdefault\fP \-\- default answer to prompt .IP \(bu 2 \fBcli_flag\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- command line option for setting an answer to this question .IP \(bu 2 \fBforce_interactive\fP (\X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link') \-\- 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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' ArgumentParser options namespace (prefix of all options). .UNINDENT .INDENT 0.0 .TP .B certbot.plugins.common.dest_namespace(name: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' ArgumentParser dest namespace (prefix of all destinations). .UNINDENT .INDENT 0.0 .TP .B class certbot.plugins.common.Plugin(config: NamespaceConfig, name: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') Bases: \fI\%Plugin\fP .sp Generic plugin. .INDENT 7.0 .TP .B abstractmethod classmethod add_parser_arguments(add: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Callable'\fI\%Callable\fP\X'tty: link'[[\&...], \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link']) -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' Add plugin arguments to the CLI argument parser. .INDENT 7.0 .TP .B Parameters \fBadd\fP (\fIcallable\fP) \-\- Function that proxies calls to \X'tty: link https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser.add_argument'\fI\%argparse.ArgumentParser.add_argument\fP\X'tty: link' prepending options with unique plugin name prefix. .UNINDENT .UNINDENT .INDENT 7.0 .TP .B classmethod inject_parser_options(parser: \X'tty: link https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser'\fI\%ArgumentParser\fP\X'tty: link', name: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' Inject parser options. .sp See \fI\%inject_parser_options\fP for docs. .UNINDENT .INDENT 7.0 .TP .B property option_namespace: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' ArgumentParser options namespace (prefix of all options). .UNINDENT .INDENT 7.0 .TP .B option_name(name: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' Option name (include plugin namespace). .UNINDENT .INDENT 7.0 .TP .B property dest_namespace: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' ArgumentParser dest namespace (prefix of all destinations). .UNINDENT .INDENT 7.0 .TP .B dest(var: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' Find a destination for given variable \fBvar\fP\&. .UNINDENT .INDENT 7.0 .TP .B conf(var: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link' Find a configuration value for variable \fBvar\fP\&. .UNINDENT .INDENT 7.0 .TP .B auth_hint(failed_achalls: \X'tty: link https://docs.python.org/3/library/typing.html#typing.List'\fI\%List\fP\X'tty: link'[\fI\%AnnotatedChallenge\fP]) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#list'\fI\%list\fP\X'tty: link') \-\- 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: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link', **kwargs: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link') 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: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Set'\fI\%Set\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'], save_notes: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', temporary: \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' = False) -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' Add files to a checkpoint. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBsave_files\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#set'\fI\%set\fP\X'tty: link') \-\- set of filepaths to save .IP \(bu 2 \fBsave_notes\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- notes about changes during the save .IP \(bu 2 \fBtemporary\fP (\X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link') \-\- 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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' Timestamp and save changes made through the reverter. .INDENT 7.0 .TP .B Parameters \fBtitle\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- Title describing checkpoint .TP .B Raises \fB\&.errors.PluginError\fP \-\- when an error occurs .UNINDENT .UNINDENT .INDENT 7.0 .TP .B recovery_routine() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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: \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' = 1) -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' Rollback saved checkpoints. .INDENT 7.0 .TP .B Parameters \fBrollback\fP (\X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link') \-\- 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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' Full absolute path to ssl_dhparams file. .UNINDENT .INDENT 7.0 .TP .B property updated_ssl_dhparams_digest: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' Full absolute path to digest of updated ssl_dhparams file. .UNINDENT .INDENT 7.0 .TP .B install_ssl_dhparams() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link', **kwargs: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link') 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: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Tuple'\fI\%Tuple\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'], ipv6: \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' = False) Bases: \X'tty: link https://docs.python.org/3/library/functions.html#object'\fI\%object\fP\X'tty: link' .sp Represents an virtual host address. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBaddr\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- addr part of vhost address .IP \(bu 2 \fBport\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- port number or *, or \(dq\(dq .UNINDENT .UNINDENT .INDENT 7.0 .TP .B classmethod fromstring(str_addr: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> GenericAddr Initialize Addr from string. .UNINDENT .INDENT 7.0 .TP .B normalized_tuple() -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.Tuple'\fI\%Tuple\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'] Normalized representation of addr/port tuple .UNINDENT .INDENT 7.0 .TP .B get_addr() -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' Return addr part of Addr object. .UNINDENT .INDENT 7.0 .TP .B get_port() -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' Return port. .UNINDENT .INDENT 7.0 .TP .B get_addr_obj(port: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> GenericAddr Return new address object with same addr and new port. .UNINDENT .INDENT 7.0 .TP .B get_ipv6_exploded() -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' Return IPv6 in normalized form .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class certbot.plugins.common.ChallengePerformer(configurator: \fI\%Configurator\fP) Bases: \X'tty: link https://docs.python.org/3/library/functions.html#object'\fI\%object\fP\X'tty: link' .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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#list'\fI\%list\fP\X'tty: link' of \fI\%KeyAuthorizationAnnotatedChallenge\fP) \-\- Annotated challenges .IP \(bu 2 \fBindices\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#list'\fI\%list\fP\X'tty: link' of \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link') \-\- 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: \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' = None) -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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 (\X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link') \-\- index to challenge in a larger array .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B perform() -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.List'\fI\%List\fP\X'tty: link'[\X'tty: link https://acme-python.readthedocs.io/en/latest/api/challenges.html#acme.challenges.KeyAuthorizationChallengeResponse'\fI\%KeyAuthorizationChallengeResponse\fP\X'tty: link'] Perform all added challenges. .INDENT 7.0 .TP .B Returns challenge responses .TP .B Return type \X'tty: link https://docs.python.org/3/library/stdtypes.html#list'\fI\%list\fP\X'tty: link' of \X'tty: link https://acme-python.readthedocs.io/en/latest/api/challenges.html#acme.challenges.KeyAuthorizationChallengeResponse'\fI\%acme.challenges.KeyAuthorizationChallengeResponse\fP\X'tty: link' .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.plugins.common.install_version_controlled_file(dest_path: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', digest_path: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', src_path: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', all_hashes: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Iterable'\fI\%Iterable\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link']) -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- destination path for version controlled file .IP \(bu 2 \fBdigest_path\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- path to save a digest of the file in .IP \(bu 2 \fBsrc_path\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- path to version controlled file found in distribution .IP \(bu 2 \fBall_hashes\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#list'\fI\%list\fP\X'tty: link') \-\- hashes of every released version of the file .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.plugins.common.dir_setup(test_dir: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', pkg: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.Tuple'\fI\%Tuple\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'] 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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') Bases: \fI\%Plugin\fP, \fI\%Authenticator\fP .sp Base class for DNS Authenticators .INDENT 7.0 .TP .B classmethod add_parser_arguments(add: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Callable'\fI\%Callable\fP\X'tty: link'[[\&...], \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link'], default_propagation_seconds: \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' = 10) -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' Add plugin arguments to the CLI argument parser. .INDENT 7.0 .TP .B Parameters \fBadd\fP (\fIcallable\fP) \-\- Function that proxies calls to \X'tty: link https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser.add_argument'\fI\%argparse.ArgumentParser.add_argument\fP\X'tty: link' prepending options with unique plugin name prefix. .UNINDENT .UNINDENT .INDENT 7.0 .TP .B auth_hint(failed_achalls: \X'tty: link https://docs.python.org/3/library/typing.html#typing.List'\fI\%List\fP\X'tty: link'[\fI\%AnnotatedChallenge\fP]) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' See certbot.plugins.common.Plugin.auth_hint. .UNINDENT .INDENT 7.0 .TP .B get_chall_pref(unused_domain: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.Iterable'\fI\%Iterable\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/typing.html#typing.Type'\fI\%Type\fP\X'tty: link'[\X'tty: link https://acme-python.readthedocs.io/en/latest/api/challenges.html#acme.challenges.Challenge'\fI\%Challenge\fP\X'tty: link']] Return \fBcollections.Iterable\fP of challenge preferences. .INDENT 7.0 .TP .B Parameters \fBdomain\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- Domain for which challenge preferences are sought. .TP .B Returns \fBcollections.Iterable\fP of challenge types (subclasses of \X'tty: link https://acme-python.readthedocs.io/en/latest/api/challenges.html#acme.challenges.Challenge'\fI\%acme.challenges.Challenge\fP\X'tty: link') 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() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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() -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' 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: \X'tty: link https://docs.python.org/3/library/typing.html#typing.List'\fI\%List\fP\X'tty: link'[\fI\%AnnotatedChallenge\fP]) -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.List'\fI\%List\fP\X'tty: link'[\X'tty: link https://acme-python.readthedocs.io/en/latest/api/challenges.html#acme.challenges.ChallengeResponse'\fI\%ChallengeResponse\fP\X'tty: link'] Perform the given challenge. .INDENT 7.0 .TP .B Parameters \fBachalls\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#list'\fI\%list\fP\X'tty: link') \-\- 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 \X'tty: link https://acme-python.readthedocs.io/en/latest/api/challenges.html#acme.challenges.ChallengeResponse'\fI\%ChallengeResponse\fP\X'tty: link' instances corresponding to each provided \X'tty: link https://acme-python.readthedocs.io/en/latest/api/challenges.html#acme.challenges.Challenge'\fI\%Challenge\fP\X'tty: link'\&. .TP .B Return type \fBcollections.List\fP of \X'tty: link https://acme-python.readthedocs.io/en/latest/api/challenges.html#acme.challenges.ChallengeResponse'\fI\%acme.challenges.ChallengeResponse\fP\X'tty: link', 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: \X'tty: link https://docs.python.org/3/library/typing.html#typing.List'\fI\%List\fP\X'tty: link'[\fI\%AnnotatedChallenge\fP]) -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#list'\fI\%list\fP\X'tty: link') \-\- 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: \X'tty: link https://docs.python.org/3/library/functions.html#object'\fI\%object\fP\X'tty: link' .sp Represents a user\-supplied filed which stores API credentials. .INDENT 7.0 .TP .B require(required_variables: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Mapping'\fI\%Mapping\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link']) -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' Ensures that the supplied set of variables are all present in the file. .INDENT 7.0 .TP .B Parameters \fBrequired_variables\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#dict'\fI\%dict\fP\X'tty: link') \-\- 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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' Find a configuration value for variable \fBvar\fP, as transformed by \fBmapper\fP\&. .INDENT 7.0 .TP .B Parameters \fBvar\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- The variable to get. .TP .B Returns The value of the variable, if it exists. .TP .B Return type \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' or None .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.plugins.dns_common.validate_file(filename: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' Ensure that the specified file exists. .UNINDENT .INDENT 0.0 .TP .B certbot.plugins.dns_common.validate_file_permissions(filename: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.List'\fI\%List\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'] 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- The domain for which to return guesses. .TP .B Returns The a list of less specific domain names. .TP .B Return type \X'tty: link https://docs.python.org/3/library/stdtypes.html#list'\fI\%list\fP\X'tty: link' .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: \X'tty: link https://docs.python.org/3/library/functions.html#object'\fI\%object\fP\X'tty: link' .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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', record_name: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', record_content: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' Add a TXT record using the supplied information. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBdomain\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- The domain to use to look up the managed zone. .IP \(bu 2 \fBrecord_name\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- The record name (typically beginning with \(aq_acme\-challenge.\(aq). .IP \(bu 2 \fBrecord_content\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- 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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', record_name: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', record_content: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' Delete a TXT record using the supplied information. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBdomain\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- The domain to use to look up the managed zone. .IP \(bu 2 \fBrecord_name\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- The record name (typically beginning with \(aq_acme\-challenge.\(aq). .IP \(bu 2 \fBrecord_content\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- 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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', lexicon_options: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Mapping'\fI\%Mapping\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link'], provider_options: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Mapping'\fI\%Mapping\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link']) -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' | \X'tty: link https://docs.python.org/3/library/typing.html#typing.Dict'\fI\%Dict\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link'] 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- the name of the lexicon provider to use .IP \(bu 2 \fBlexicon_options\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#dict'\fI\%dict\fP\X'tty: link') \-\- options specific to lexicon .IP \(bu 2 \fBprovider_options\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#dict'\fI\%dict\fP\X'tty: link') \-\- options specific to provider .UNINDENT .TP .B Returns configuration to apply to the provider .TP .B Return type ConfigurationResolver or \X'tty: link https://docs.python.org/3/library/stdtypes.html#dict'\fI\%dict\fP\X'tty: link' .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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') 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: \X'tty: link https://docs.python.org/3/library/functions.html#object'\fI\%object\fP\X'tty: link' .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() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' .UNINDENT .INDENT 7.0 .TP .B test_get_chall_pref() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' .UNINDENT .INDENT 7.0 .TP .B test_parser_arguments() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.plugins.dns_test_common.write(values: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Mapping'\fI\%Mapping\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link'], path: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' Write the specified values to a config file. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBvalues\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#dict'\fI\%dict\fP\X'tty: link') \-\- A map of values to write. .IP \(bu 2 \fBpath\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- 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: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' .UNINDENT .INDENT 7.0 .TP .B test_cleanup() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class certbot.plugins.dns_test_common_lexicon.BaseLexiconClientTest Bases: \X'tty: link https://docs.python.org/3/library/functions.html#object'\fI\%object\fP\X'tty: link' .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() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' .UNINDENT .INDENT 7.0 .TP .B test_add_txt_record_try_twice_to_find_domain() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' .UNINDENT .INDENT 7.0 .TP .B test_add_txt_record_fail_to_find_domain() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' .UNINDENT .INDENT 7.0 .TP .B test_add_txt_record_fail_to_authenticate() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' .UNINDENT .INDENT 7.0 .TP .B test_add_txt_record_fail_to_authenticate_with_unknown_error() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' .UNINDENT .INDENT 7.0 .TP .B test_add_txt_record_error_finding_domain() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' .UNINDENT .INDENT 7.0 .TP .B test_add_txt_record_error_adding_record() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' .UNINDENT .INDENT 7.0 .TP .B test_del_txt_record() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' .UNINDENT .INDENT 7.0 .TP .B test_del_txt_record_fail_to_find_domain() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' .UNINDENT .INDENT 7.0 .TP .B test_del_txt_record_fail_to_authenticate() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' .UNINDENT .INDENT 7.0 .TP .B test_del_txt_record_fail_to_authenticate_with_unknown_error() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' .UNINDENT .INDENT 7.0 .TP .B test_del_txt_record_error_finding_domain() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' .UNINDENT .INDENT 7.0 .TP .B test_del_txt_record_error_deleting_record() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' .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() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' .UNINDENT .INDENT 7.0 .TP .B test_perform_with_one_domain_resolution_failure_succeed() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' .UNINDENT .INDENT 7.0 .TP .B test_perform_with_two_domain_resolution_failures_raise() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' .UNINDENT .INDENT 7.0 .TP .B test_perform_with_domain_resolution_general_failure_raise() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' .UNINDENT .INDENT 7.0 .TP .B test_perform_with_auth_failure_raise() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' .UNINDENT .INDENT 7.0 .TP .B test_perform_with_unknown_auth_failure_raise() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' .UNINDENT .INDENT 7.0 .TP .B test_perform_with_create_record_failure_raise() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' .UNINDENT .INDENT 7.0 .TP .B test_cleanup_success() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' .UNINDENT .INDENT 7.0 .TP .B test_cleanup_with_auth_failure_ignore() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' .UNINDENT .INDENT 7.0 .TP .B test_cleanup_with_unknown_auth_failure_ignore() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' .UNINDENT .INDENT 7.0 .TP .B test_cleanup_with_domain_resolution_failure_ignore() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' .UNINDENT .INDENT 7.0 .TP .B test_cleanup_with_domain_resolution_general_failure_ignore() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' .UNINDENT .INDENT 7.0 .TP .B test_cleanup_with_delete_record_failure_ignore() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' .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) -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.Generator'\fI\%Generator\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/typing.html#typing.Dict'\fI\%Dict\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link'], \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link', \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link'] 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) -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' 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 | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' 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 \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.plugins.enhancements.enable(lineage: \fI\%RenewableCert\fP | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link', domains: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Iterable'\fI\%Iterable\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'], installer: \fI\%Installer\fP | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link', config: NamespaceConfig) -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- 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: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Callable'\fI\%Callable\fP\X'tty: link'[[\&...], \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link']) -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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: \X'tty: link https://docs.python.org/3/library/functions.html#object'\fI\%object\fP\X'tty: link' .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 abstractmethod update_autohsts(lineage: \fI\%RenewableCert\fP, *args: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link', **kwargs: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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 abstractmethod deploy_autohsts(lineage: \fI\%RenewableCert\fP, *args: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link', **kwargs: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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 abstractmethod enable_autohsts(lineage: \fI\%RenewableCert\fP | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link', domains: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Iterable'\fI\%Iterable\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'], *args: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link', **kwargs: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#list'\fI\%list\fP\X'tty: link' of \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- 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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') Bases: \X'tty: link https://docs.python.org/3/library/functions.html#object'\fI\%object\fP\X'tty: link' .sp Class implementing storage functionality for plugins .INDENT 7.0 .TP .B save() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', value: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' Put configuration value to PluginStorage .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBkey\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- Key to store the value to .IP \(bu 2 \fBvalue\fP \-\- Data to store .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B fetch(key: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link' Get configuration value from PluginStorage .INDENT 7.0 .TP .B Parameters \fBkey\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- Key to get value from the storage .TP .B Raises \X'tty: link https://docs.python.org/3/library/exceptions.html#KeyError'\fI\%KeyError\fP\X'tty: link' \-\- 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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.List'\fI\%List\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'] 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- the path to break into prefixes .TP .B Returns all possible path prefixes of given path in descending order .TP .B Return type \X'tty: link https://docs.python.org/3/library/stdtypes.html#list'\fI\%list\fP\X'tty: link' of \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.plugins.util.path_surgery(cmd: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' Attempt to perform PATH surgery to find cmd .sp Mitigates \X'tty: link https://github.com/certbot/certbot/issues/1833'\fI\%https://github.com/certbot/certbot/issues/1833\fP\X'tty: link' .INDENT 7.0 .TP .B Parameters \fBcmd\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- 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: \X'tty: link https://acme-python.readthedocs.io/en/latest/api/challenges.html#acme.challenges.Challenge'\fI\%Challenge\fP\X'tty: link', status: \X'tty: link https://acme-python.readthedocs.io/en/latest/api/messages.html#acme.messages.Status'\fI\%Status\fP\X'tty: link') -> \X'tty: link https://acme-python.readthedocs.io/en/latest/api/messages.html#acme.messages.ChallengeBody'\fI\%ChallengeBody\fP\X'tty: link' Return ChallengeBody from Challenge. .UNINDENT .INDENT 0.0 .TP .B certbot.tests.acme_util.gen_authzr(authz_status: \X'tty: link https://acme-python.readthedocs.io/en/latest/api/messages.html#acme.messages.Status'\fI\%Status\fP\X'tty: link', domain: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', challs: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Iterable'\fI\%Iterable\fP\X'tty: link'[\X'tty: link https://acme-python.readthedocs.io/en/latest/api/challenges.html#acme.challenges.Challenge'\fI\%Challenge\fP\X'tty: link'], statuses: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Iterable'\fI\%Iterable\fP\X'tty: link'[\X'tty: link https://acme-python.readthedocs.io/en/latest/api/messages.html#acme.messages.Status'\fI\%Status\fP\X'tty: link']) -> \X'tty: link https://acme-python.readthedocs.io/en/latest/api/messages.html#acme.messages.AuthorizationResource'\fI\%AuthorizationResource\fP\X'tty: link' Generate an authorization resource. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBauthz_status\fP (\X'tty: link https://acme-python.readthedocs.io/en/latest/api/messages.html#acme.messages.Status'\fI\%acme.messages.Status\fP\X'tty: link') \-\- Status object .IP \(bu 2 \fBchalls\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#list'\fI\%list\fP\X'tty: link') \-\- Challenge objects .IP \(bu 2 \fBstatuses\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#list'\fI\%list\fP\X'tty: link') \-\- 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: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link', **kwargs: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link') Bases: \fI\%Installer\fP .sp Dummy installer plugin for test purpose. .INDENT 7.0 .TP .B get_all_names() -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.Iterable'\fI\%Iterable\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'] Returns all names that may be authenticated. .INDENT 7.0 .TP .B Return type \fBcollections.Iterable\fP of \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 7.0 .TP .B deploy_cert(domain: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', cert_path: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', key_path: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', chain_path: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', fullchain_path: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' Deploy certificate. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBdomain\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- domain to deploy certificate file .IP \(bu 2 \fBcert_path\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- absolute path to the certificate file .IP \(bu 2 \fBkey_path\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- absolute path to the private key file .IP \(bu 2 \fBchain_path\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- absolute path to the certificate chain file .IP \(bu 2 \fBfullchain_path\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- 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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', enhancement: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', options: \X'tty: link https://docs.python.org/3/library/typing.html#typing.List'\fI\%List\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'] | \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' = None) -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' Perform a configuration enhancement. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBdomain\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- domain for which to provide enhancement .IP \(bu 2 \fBenhancement\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- 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() -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.List'\fI\%List\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'] 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 \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 7.0 .TP .B save(title: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' = None, temporary: \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' = False) -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- 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 (\X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link') \-\- 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() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Callable'\fI\%Callable\fP\X'tty: link'[[\&...], \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link']) -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' Add plugin arguments to the CLI argument parser. .INDENT 7.0 .TP .B Parameters \fBadd\fP (\fIcallable\fP) \-\- Function that proxies calls to \X'tty: link https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser.add_argument'\fI\%argparse.ArgumentParser.add_argument\fP\X'tty: link' prepending options with unique plugin name prefix. .UNINDENT .UNINDENT .INDENT 7.0 .TP .B prepare() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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() -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' 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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' Path to a test vector. .UNINDENT .INDENT 0.0 .TP .B certbot.tests.util.load_vector(*names: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#bytes'\fI\%bytes\fP\X'tty: link' Load contents of a test vector. .UNINDENT .INDENT 0.0 .TP .B certbot.tests.util.load_cert(*names: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> X509 Load certificate. .UNINDENT .INDENT 0.0 .TP .B certbot.tests.util.load_csr(*names: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> X509Req Load certificate request. .UNINDENT .INDENT 0.0 .TP .B certbot.tests.util.load_comparable_csr(*names: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> ComparableX509 Load ComparableX509 certificate request. .UNINDENT .INDENT 0.0 .TP .B certbot.tests.util.load_jose_rsa_private_key_pem(*names: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> ComparableRSAKey Load RSA private key wrapped in jose.ComparableRSAKey .UNINDENT .INDENT 0.0 .TP .B certbot.tests.util.load_rsa_private_key_pem(*names: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> RSAPrivateKey Load RSA private key. .UNINDENT .INDENT 0.0 .TP .B certbot.tests.util.make_lineage(config_dir: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', testfile: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', ec: \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' = True) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- path to the configuration directory .IP \(bu 2 \fBtestfile\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- configuration file to base the lineage on .IP \(bu 2 \fBec\fP (\X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link') \-\- 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 \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.tests.util.patch_display_util() -> \X'tty: link https://docs.python.org/3/library/unittest.mock.html#unittest.mock.MagicMock'\fI\%MagicMock\fP\X'tty: link' 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 \X'tty: link https://github.com/certbot/certbot/issues/8948'\fI\%https://github.com/certbot/certbot/issues/8948\fP\X'tty: link' .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: \X'tty: link https://docs.python.org/3/library/typing.html#typing.IO'\fI\%IO\fP\X'tty: link' | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' = None) -> \X'tty: link https://docs.python.org/3/library/unittest.mock.html#unittest.mock.MagicMock'\fI\%MagicMock\fP\X'tty: link' 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 \X'tty: link https://github.com/certbot/certbot/issues/8948'\fI\%https://github.com/certbot/certbot/issues/8948\fP\X'tty: link' .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 (\X'tty: link https://docs.python.org/3/library/functions.html#object'\fI\%object\fP\X'tty: link') \-\- 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: \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' = False, func: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Callable'\fI\%Callable\fP\X'tty: link'[[\&...], \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link'] | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' = None, return_value: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link' = sentinel.DEFAULT) Bases: \X'tty: link https://docs.python.org/3/library/functions.html#object'\fI\%object\fP\X'tty: link' .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() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' Execute before test .UNINDENT .INDENT 7.0 .TP .B tearDown() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' Execute before test .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.tests.util.lock_and_call(callback: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Callable'\fI\%Callable\fP\X'tty: link'[[], \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link'], path_to_lock: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.Callable'\fI\%Callable\fP\X'tty: link'[[\X'tty: link https://docs.python.org/3/library/typing.html#typing.Callable'\fI\%Callable\fP\X'tty: link'[[\&...], \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link']], \X'tty: link https://docs.python.org/3/library/typing.html#typing.Callable'\fI\%Callable\fP\X'tty: link'[[\&...], \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link']] Decorator to skip permanently a test on Windows. A reason is required. .UNINDENT .INDENT 0.0 .TP .B certbot.tests.util.temp_join(path: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' 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 \X'tty: link https://acme-python.readthedocs.io/en/latest/api/challenges.html#acme.challenges.Challenge'\fI\%acme.challenges.Challenge\fP\X'tty: link' (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: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link') 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: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link') Bases: \fI\%AnnotatedChallenge\fP .sp Client annotated \fBKeyAuthorizationChallenge\fP challenge. .INDENT 7.0 .TP .B response_and_validation(*args: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link', **kwargs: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.Tuple'\fI\%Tuple\fP\X'tty: link'[\X'tty: link https://acme-python.readthedocs.io/en/latest/api/challenges.html#acme.challenges.KeyAuthorizationChallengeResponse'\fI\%KeyAuthorizationChallengeResponse\fP\X'tty: link', \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link'] 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: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link') Bases: \fI\%AnnotatedChallenge\fP .sp Client annotated \(dqdns\(dq ACME challenge. .INDENT 7.0 .TP .B acme_type alias of \X'tty: link https://acme-python.readthedocs.io/en/latest/api/challenges.html#acme.challenges.DNS'\fI\%DNS\fP\X'tty: link' .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: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link') Bases: \fI\%AnnotatedChallenge\fP .sp Client annotated ACME challenge of an unknown type. .INDENT 7.0 .TP .B acme_type alias of \X'tty: link https://acme-python.readthedocs.io/en/latest/api/challenges.html#acme.challenges.Challenge'\fI\%Challenge\fP\X'tty: link' .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: \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link', key_dir: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link', key_type: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' = \(aqrsa\(aq, elliptic_curve: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' = \(aqsecp256r1\(aq, keyname: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' = \(aqkey\-certbot.pem\(aq, strict_permissions: \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' = 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 (\X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link') \-\- key size in bits if key size is rsa. .IP \(bu 2 \fBkey_dir\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- Optional key save directory. .IP \(bu 2 \fBkey_type\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- Key Type [rsa, ecdsa] .IP \(bu 2 \fBelliptic_curve\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- Name of the elliptic curve if key type is ecdsa. .IP \(bu 2 \fBkeyname\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- Filename of key .IP \(bu 2 \fBstrict_permissions\fP (\X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link') \-\- 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 \X'tty: link https://docs.python.org/3/library/exceptions.html#ValueError'\fI\%ValueError\fP\X'tty: link' \-\- 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: \X'tty: link https://docs.python.org/3/library/typing.html#typing.List'\fI\%List\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'] | \X'tty: link https://docs.python.org/3/library/typing.html#typing.Set'\fI\%Set\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'], path: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link', must_staple: \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' = False, strict_permissions: \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' = 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#set'\fI\%set\fP\X'tty: link') \-\- \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' names to include in the CSR .IP \(bu 2 \fBpath\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- Optional certificate save directory. .IP \(bu 2 \fBmust_staple\fP (\X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link') \-\- If true, include the TLS Feature extension \(dqOCSP Must\-Staple\(dq .IP \(bu 2 \fBstrict_permissions\fP (\X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link') \-\- 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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#bytes'\fI\%bytes\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' Validate CSR. .sp Check if \fBcsr\fP is a valid CSR with a correct self\-signed signature. .INDENT 7.0 .TP .B Parameters \fBcsr\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#bytes'\fI\%bytes\fP\X'tty: link') \-\- CSR in PEM. .TP .B Returns Validity of CSR. .TP .B Return type \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.crypto_util.csr_matches_pubkey(csr: \X'tty: link https://docs.python.org/3/library/stdtypes.html#bytes'\fI\%bytes\fP\X'tty: link', privkey: \X'tty: link https://docs.python.org/3/library/stdtypes.html#bytes'\fI\%bytes\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#bytes'\fI\%bytes\fP\X'tty: link') \-\- CSR in PEM. .IP \(bu 2 \fBprivkey\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#bytes'\fI\%bytes\fP\X'tty: link') \-\- Private key file contents (PEM) .UNINDENT .TP .B Returns Correspondence of private key to CSR subject public key. .TP .B Return type \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.crypto_util.import_csr_file(csrfile: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', data: \X'tty: link https://docs.python.org/3/library/stdtypes.html#bytes'\fI\%bytes\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.Tuple'\fI\%Tuple\fP\X'tty: link'[Format, \fI\%CSR\fP, \X'tty: link https://docs.python.org/3/library/typing.html#typing.List'\fI\%List\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link']] 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- CSR filename .IP \(bu 2 \fBdata\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#bytes'\fI\%bytes\fP\X'tty: link') \-\- contents of the CSR file .UNINDENT .TP .B Returns (\fBacme_crypto_util.Format.PEM\fP, util.CSR object representing the CSR, list of domains requested in the CSR) .TP .B Return type \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.crypto_util.make_key(bits: \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' = 2048, key_type: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' = \(aqrsa\(aq, elliptic_curve: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' = None) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#bytes'\fI\%bytes\fP\X'tty: link' Generate PEM encoded RSA|EC key. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBbits\fP (\X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link') \-\- Number of bits if key_type=rsa. At least 2048 for RSA. .IP \(bu 2 \fBkey_type\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- The type of key to generate, but be rsa or ecdsa .IP \(bu 2 \fBelliptic_curve\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- 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 \X'tty: link https://docs.python.org/3/library/stdtypes.html#bytes'\fI\%bytes\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.crypto_util.valid_privkey(privkey: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' | \X'tty: link https://docs.python.org/3/library/stdtypes.html#bytes'\fI\%bytes\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' 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 \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.crypto_util.verify_renewable_cert(renewable_cert: \fI\%RenewableCert\fP) -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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) -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#bytes'\fI\%bytes\fP\X'tty: link', payload: \X'tty: link https://docs.python.org/3/library/stdtypes.html#bytes'\fI\%bytes\fP\X'tty: link', signature_hash_algorithm: HashAlgorithm) -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#bytes'\fI\%bytes\fP\X'tty: link') \-\- the signature bytes .IP \(bu 2 \fBpayload\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#bytes'\fI\%bytes\fP\X'tty: link') \-\- 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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', key_path: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' Verifies that the private key and cert match. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBcert_path\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- path to a cert in PEM format .IP \(bu 2 \fBkey_path\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- 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) -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#bytes'\fI\%bytes\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.Tuple'\fI\%Tuple\fP\X'tty: link'[X509, \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link'] Load PEM/DER certificate. .INDENT 7.0 .TP .B Raises \fI\%errors.Error\fP \-\- .UNINDENT .sp Deprecated \&.. deprecated: 3.2.1 .UNINDENT .INDENT 0.0 .TP .B certbot.crypto_util.get_sans_from_cert(cert: \X'tty: link https://docs.python.org/3/library/stdtypes.html#bytes'\fI\%bytes\fP\X'tty: link', typ: Format | \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' = Format.PEM) -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.List'\fI\%List\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'] Get a list of Subject Alternative Names from a certificate. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBcert\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- Certificate (encoded). .IP \(bu 2 \fBtyp\fP (\fIFormat\fP) \-\- Which format the \fBcert\fP bytes are in. .UNINDENT .TP .B Returns A list of Subject Alternative Names. .TP .B Return type \X'tty: link https://docs.python.org/3/library/stdtypes.html#list'\fI\%list\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.crypto_util.get_names_from_cert(cert: \X'tty: link https://docs.python.org/3/library/stdtypes.html#bytes'\fI\%bytes\fP\X'tty: link', typ: Format | \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' = Format.PEM) -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.List'\fI\%List\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'] 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- Certificate (encoded). .IP \(bu 2 \fBtyp\fP (\fIFormat\fP) \-\- Which format the \fBcert\fP bytes are in. .UNINDENT .TP .B Returns A list of domain names. .TP .B Return type \X'tty: link https://docs.python.org/3/library/stdtypes.html#list'\fI\%list\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.crypto_util.get_names_from_req(csr: \X'tty: link https://docs.python.org/3/library/stdtypes.html#bytes'\fI\%bytes\fP\X'tty: link', typ: Format | \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' = Format.PEM) -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.List'\fI\%List\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'] 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- CSR (encoded). .IP \(bu 2 \fBtyp\fP (\fIacme_crypto_util.Format\fP) \-\- Which format the \fBcsr\fP bytes are in. .UNINDENT .TP .B Returns A list of domain names. .TP .B Return type \X'tty: link https://docs.python.org/3/library/stdtypes.html#list'\fI\%list\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.crypto_util.dump_pyopenssl_chain(chain: \X'tty: link https://docs.python.org/3/library/typing.html#typing.List'\fI\%List\fP\X'tty: link'[X509] | \X'tty: link https://docs.python.org/3/library/typing.html#typing.List'\fI\%List\fP\X'tty: link'[ComparableX509], filetype: Format | \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' = Format.PEM) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#bytes'\fI\%bytes\fP\X'tty: link' Dump certificate chain into a bundle. .INDENT 7.0 .TP .B Parameters \fBchain\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#list'\fI\%list\fP\X'tty: link') \-\- List of \fBcrypto.X509\fP (or wrapped in \fBjosepy.util.ComparableX509\fP). .UNINDENT .sp Deprecated \&.. deprecated: 3.2.1 .UNINDENT .INDENT 0.0 .TP .B certbot.crypto_util.notBefore(cert_path: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/datetime.html#datetime.datetime'\fI\%datetime\fP\X'tty: link' When does the cert at cert_path start being valid? .INDENT 7.0 .TP .B Parameters \fBcert_path\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- path to a cert in PEM format .TP .B Returns the notBefore value from the cert at cert_path .TP .B Return type \X'tty: link https://docs.python.org/3/library/datetime.html#datetime.datetime'\fI\%datetime.datetime\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.crypto_util.notAfter(cert_path: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/datetime.html#datetime.datetime'\fI\%datetime\fP\X'tty: link' When does the cert at cert_path stop being valid? .INDENT 7.0 .TP .B Parameters \fBcert_path\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- path to a cert in PEM format .TP .B Returns the notAfter value from the cert at cert_path .TP .B Return type \X'tty: link https://docs.python.org/3/library/datetime.html#datetime.datetime'\fI\%datetime.datetime\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.crypto_util.sha256sum(filename: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- path to the file whose hash will be computed .TP .B Returns sha256 digest of the file in hexadecimal .TP .B Return type \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.crypto_util.cert_and_chain_from_fullchain(fullchain_pem: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.Tuple'\fI\%Tuple\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'] Split fullchain_pem into cert_pem and chain_pem .INDENT 7.0 .TP .B Parameters \fBfullchain_pem\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- concatenated cert + chain .TP .B Returns tuple of string cert_pem and chain_pem .TP .B Return type \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link' .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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' Retrieve the serial number of a certificate from certificate path .INDENT 7.0 .TP .B Parameters \fBcert_path\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- path to a cert in PEM format .TP .B Returns serial number of the certificate .TP .B Return type \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.crypto_util.find_chain_with_issuer(fullchains: \X'tty: link https://docs.python.org/3/library/typing.html#typing.List'\fI\%List\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'], issuer_cn: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', warn_on_no_match: \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' = False) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#list'\fI\%list\fP\X'tty: link' of \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- The list of fullchains in PEM chain format. .IP \(bu 2 \fBissuer_cn\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- 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 \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' .UNINDENT .UNINDENT .SS certbot.errors module .sp Certbot client errors. .INDENT 0.0 .TP .B exception certbot.errors.Error Bases: \X'tty: link https://docs.python.org/3/library/exceptions.html#Exception'\fI\%Exception\fP\X'tty: link' .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: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Set'\fI\%Set\fP\X'tty: link'[\fI\%AnnotatedChallenge\fP]) Bases: \fI\%AuthorizationError\fP .sp Failed challenges error. .INDENT 7.0 .TP .B Variables \fBfailed_achalls\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#set'\fI\%set\fP\X'tty: link') \-\- 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: \X'tty: link https://docs.python.org/3/library/exceptions.html#OSError'\fI\%OSError\fP\X'tty: link', port: \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link') 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: \X'tty: link https://docs.python.org/3/library/functions.html#object'\fI\%object\fP\X'tty: link' .sp Accounts storage interface. .INDENT 7.0 .TP .B abstractmethod find_all() -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.List'\fI\%List\fP\X'tty: link'[Account] Find all accounts. .INDENT 7.0 .TP .B Returns All found accounts. .TP .B Return type \X'tty: link https://docs.python.org/3/library/stdtypes.html#list'\fI\%list\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 7.0 .TP .B abstractmethod load(account_id: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> 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 abstractmethod save(account: Account, client: \X'tty: link https://acme-python.readthedocs.io/en/latest/api/client.html#acme.client.ClientV2'\fI\%ClientV2\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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 | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link', name: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') Bases: \X'tty: link https://docs.python.org/3/library/functions.html#object'\fI\%object\fP\X'tty: link' .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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' = NotImplemented Short plugin description .UNINDENT .INDENT 7.0 .TP .B name: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' = NotImplemented Unique name of the plugin .UNINDENT .INDENT 7.0 .TP .B abstractmethod prepare() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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 abstractmethod more_info() -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' 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 abstractmethod classmethod inject_parser_options(parser: \X'tty: link https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser'\fI\%ArgumentParser\fP\X'tty: link', name: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- Unique plugin name. .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class certbot.interfaces.Authenticator(config: NamespaceConfig | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link', name: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') 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 abstractmethod get_chall_pref(domain: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.Iterable'\fI\%Iterable\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/typing.html#typing.Type'\fI\%Type\fP\X'tty: link'[\X'tty: link https://acme-python.readthedocs.io/en/latest/api/challenges.html#acme.challenges.Challenge'\fI\%Challenge\fP\X'tty: link']] Return \fBcollections.Iterable\fP of challenge preferences. .INDENT 7.0 .TP .B Parameters \fBdomain\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- Domain for which challenge preferences are sought. .TP .B Returns \fBcollections.Iterable\fP of challenge types (subclasses of \X'tty: link https://acme-python.readthedocs.io/en/latest/api/challenges.html#acme.challenges.Challenge'\fI\%acme.challenges.Challenge\fP\X'tty: link') 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 abstractmethod perform(achalls: \X'tty: link https://docs.python.org/3/library/typing.html#typing.List'\fI\%List\fP\X'tty: link'[\fI\%AnnotatedChallenge\fP]) -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.List'\fI\%List\fP\X'tty: link'[\X'tty: link https://acme-python.readthedocs.io/en/latest/api/challenges.html#acme.challenges.ChallengeResponse'\fI\%ChallengeResponse\fP\X'tty: link'] Perform the given challenge. .INDENT 7.0 .TP .B Parameters \fBachalls\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#list'\fI\%list\fP\X'tty: link') \-\- 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 \X'tty: link https://acme-python.readthedocs.io/en/latest/api/challenges.html#acme.challenges.ChallengeResponse'\fI\%ChallengeResponse\fP\X'tty: link' instances corresponding to each provided \X'tty: link https://acme-python.readthedocs.io/en/latest/api/challenges.html#acme.challenges.Challenge'\fI\%Challenge\fP\X'tty: link'\&. .TP .B Return type \fBcollections.List\fP of \X'tty: link https://acme-python.readthedocs.io/en/latest/api/challenges.html#acme.challenges.ChallengeResponse'\fI\%acme.challenges.ChallengeResponse\fP\X'tty: link', 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 abstractmethod cleanup(achalls: \X'tty: link https://docs.python.org/3/library/typing.html#typing.List'\fI\%List\fP\X'tty: link'[\fI\%AnnotatedChallenge\fP]) -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#list'\fI\%list\fP\X'tty: link') \-\- 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 | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link', name: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') 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 abstractmethod get_all_names() -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.Iterable'\fI\%Iterable\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'] Returns all names that may be authenticated. .INDENT 7.0 .TP .B Return type \fBcollections.Iterable\fP of \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 7.0 .TP .B abstractmethod deploy_cert(domain: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', cert_path: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', key_path: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', chain_path: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', fullchain_path: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' Deploy certificate. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBdomain\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- domain to deploy certificate file .IP \(bu 2 \fBcert_path\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- absolute path to the certificate file .IP \(bu 2 \fBkey_path\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- absolute path to the private key file .IP \(bu 2 \fBchain_path\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- absolute path to the certificate chain file .IP \(bu 2 \fBfullchain_path\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- 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 abstractmethod enhance(domain: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', enhancement: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', options: \X'tty: link https://docs.python.org/3/library/typing.html#typing.List'\fI\%List\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'] | \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' = None) -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' Perform a configuration enhancement. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBdomain\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- domain for which to provide enhancement .IP \(bu 2 \fBenhancement\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- 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 abstractmethod supported_enhancements() -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.List'\fI\%List\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'] 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 \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 7.0 .TP .B abstractmethod save(title: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' = None, temporary: \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' = False) -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- 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 (\X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link') \-\- 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 abstractmethod rollback_checkpoints(rollback: \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' = 1) -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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 abstractmethod recovery_routine() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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 abstractmethod config_test() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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 abstractmethod restart() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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: \X'tty: link https://docs.python.org/3/library/functions.html#object'\fI\%object\fP\X'tty: link' .sp Interface to a certificate lineage. .INDENT 7.0 .TP .B abstract property cert_path: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' Path to the certificate file. .INDENT 7.0 .TP .B Return type \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 7.0 .TP .B abstract property key_path: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' Path to the private key file. .INDENT 7.0 .TP .B Return type \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 7.0 .TP .B abstract property chain_path: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' Path to the certificate chain file. .INDENT 7.0 .TP .B Return type \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 7.0 .TP .B abstract property fullchain_path: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' 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 \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 7.0 .TP .B abstract property lineagename: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' Name given to the certificate lineage. .INDENT 7.0 .TP .B Return type \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 7.0 .TP .B abstractmethod names() -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.List'\fI\%List\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'] What are the subject names of this certificate? .INDENT 7.0 .TP .B Returns the subject names .TP .B Return type \X'tty: link https://docs.python.org/3/library/stdtypes.html#list'\fI\%list\fP\X'tty: link' of \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' .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: \X'tty: link https://docs.python.org/3/library/functions.html#object'\fI\%object\fP\X'tty: link' .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 abstractmethod generic_updates(lineage: \fI\%RenewableCert\fP, *args: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link', **kwargs: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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: \X'tty: link https://docs.python.org/3/library/functions.html#object'\fI\%object\fP\X'tty: link' .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 abstractmethod renew_deploy(lineage: \fI\%RenewableCert\fP, *args: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link', **kwargs: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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 .INDENT 0.0 .TP .B class certbot.interfaces.IPluginFactory Bases: \X'tty: link https://docs.python.org/3/library/functions.html#object'\fI\%object\fP\X'tty: link' .sp Compatibility shim for plugins that still use Certbot\(aqs old zope.interface classes. .UNINDENT .INDENT 0.0 .TP .B class certbot.interfaces.IPlugin Bases: \X'tty: link https://docs.python.org/3/library/functions.html#object'\fI\%object\fP\X'tty: link' .sp Compatibility shim for plugins that still use Certbot\(aqs old zope.interface classes. .UNINDENT .INDENT 0.0 .TP .B class certbot.interfaces.IAuthenticator Bases: \fI\%IPlugin\fP .sp Compatibility shim for plugins that still use Certbot\(aqs old zope.interface classes. .UNINDENT .INDENT 0.0 .TP .B class certbot.interfaces.IInstaller Bases: \fI\%IPlugin\fP .sp Compatibility shim for plugins that still use Certbot\(aqs old zope.interface classes. .UNINDENT .SS certbot.main module .sp Certbot main public entry point. .INDENT 0.0 .TP .B certbot.main.main(cli_args: \X'tty: link https://docs.python.org/3/library/typing.html#typing.List'\fI\%List\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'] | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' = None) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' | \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' Run Certbot. .INDENT 7.0 .TP .B Parameters \fBcli_args\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#list'\fI\%list\fP\X'tty: link' of \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- command line to Certbot, defaults to \fBsys.argv[1:]\fP .TP .B Returns value for \X'tty: link https://docs.python.org/3/library/sys.html#sys.exit'\fI\%sys.exit\fP\X'tty: link' about the exit status of Certbot .TP .B Return type \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' or \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' or \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' .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: \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' = False) Bases: \X'tty: link https://docs.python.org/3/library/functions.html#object'\fI\%object\fP\X'tty: link' .sp This class figures out OCSP checking on this system, and performs it. .INDENT 7.0 .TP .B ocsp_revoked(cert: \fI\%RenewableCert\fP) -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' 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 \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 7.0 .TP .B ocsp_revoked_by_paths(cert_path: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', chain_path: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', timeout: \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' = 10) -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' Performs the OCSP revocation check .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBcert_path\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- Certificate filepath .IP \(bu 2 \fBchain_path\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- Certificate chain .IP \(bu 2 \fBtimeout\fP (\X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link') \-\- 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 \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' .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: \X'tty: link https://docs.python.org/3/library/functions.html#object'\fI\%object\fP\X'tty: link' .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() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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: \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' = 1) -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' Revert \(aqrollback\(aq number of configuration checkpoints. .INDENT 7.0 .TP .B Parameters \fBrollback\fP (\X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link') \-\- 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: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Set'\fI\%Set\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'], save_notes: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' Add files to temporary checkpoint. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBsave_files\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#set'\fI\%set\fP\X'tty: link') \-\- set of filepaths to save .IP \(bu 2 \fBsave_notes\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- notes about changes during the save .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B add_to_checkpoint(save_files: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Set'\fI\%Set\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'], save_notes: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' Add files to a permanent checkpoint. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBsave_files\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#set'\fI\%set\fP\X'tty: link') \-\- set of filepaths to save .IP \(bu 2 \fBsave_notes\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- notes about changes during the save .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B register_file_creation(temporary: \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link', *files: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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 (\X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link') \-\- 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: \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link', command: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Iterable'\fI\%Iterable\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link']) -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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 (\X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link') \-\- Whether the command should be saved in the IN_PROGRESS or TEMPORARY checkpoints. .IP \(bu 2 \fBcommand\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#list'\fI\%list\fP\X'tty: link'\fI of \fP\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- Command to be run. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B recovery_routine() -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- 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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link', pem: \X'tty: link https://docs.python.org/3/library/stdtypes.html#bytes'\fI\%bytes\fP\X'tty: link') Bases: \X'tty: link https://docs.python.org/3/library/typing.html#typing.NamedTuple'\fI\%NamedTuple\fP\X'tty: link' .sp Container for an optional file path and contents for a PEM\-formated private key. .INDENT 7.0 .TP .B file: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' Alias for field number 0 .UNINDENT .INDENT 7.0 .TP .B pem: \X'tty: link https://docs.python.org/3/library/stdtypes.html#bytes'\fI\%bytes\fP\X'tty: link' Alias for field number 1 .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class certbot.util.CSR(file: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link', data: \X'tty: link https://docs.python.org/3/library/stdtypes.html#bytes'\fI\%bytes\fP\X'tty: link', form: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') Bases: \X'tty: link https://docs.python.org/3/library/typing.html#typing.NamedTuple'\fI\%NamedTuple\fP\X'tty: link' .sp Container for an optional file path and contents for a PEM or DER\-formatted CSR. .INDENT 7.0 .TP .B file: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' Alias for field number 0 .UNINDENT .INDENT 7.0 .TP .B data: \X'tty: link https://docs.python.org/3/library/stdtypes.html#bytes'\fI\%bytes\fP\X'tty: link' Alias for field number 1 .UNINDENT .INDENT 7.0 .TP .B form: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' Alias for field number 2 .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class certbot.util.LooseVersion(version_string: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') Bases: \X'tty: link https://docs.python.org/3/library/functions.html#object'\fI\%object\fP\X'tty: link' .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: (\X'tty: link https://github.com/python/cpython/blob/v3.10.0/Lib/distutils/version.py#L269'\fI\%https://github.com/python/cpython/blob/v3.10.0/Lib/distutils/version.py#L269\fP\X'tty: link') 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) -> \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' 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() -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.Dict'\fI\%Dict\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'] 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 \X'tty: link https://docs.python.org/3/library/stdtypes.html#dict'\fI\%dict\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.util.run_script(params: ~typing.List[str], log: ~typing.Callable[[str], None] = >) -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.Tuple'\fI\%Tuple\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'] Run the script with the given params. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBparams\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#list'\fI\%list\fP\X'tty: link') \-\- 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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' Determine whether path/name refers to an executable. .INDENT 7.0 .TP .B Parameters \fBexe\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- Executable path or name .TP .B Returns If exe is a valid executable .TP .B Return type \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.util.lock_dir_until_exit(dir_path: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' Lock the directory at dir_path until program exit. .INDENT 7.0 .TP .B Parameters \fBdir_path\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- 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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', mode: \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link', strict: \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' Ensure directory exists with proper permissions and is locked. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBdirectory\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- Path to a directory. .IP \(bu 2 \fBmode\fP (\X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link') \-\- Directory mode. .IP \(bu 2 \fBstrict\fP (\X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link') \-\- 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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', mode: \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' = 493, strict: \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' = False) -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' Make sure directory exists with proper permissions. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBdirectory\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- Path to a directory. .IP \(bu 2 \fBmode\fP (\X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link') \-\- Directory mode. .IP \(bu 2 \fBstrict\fP (\X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link') \-\- 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 \X'tty: link https://docs.python.org/3/library/exceptions.html#OSError'\fI\%OSError\fP\X'tty: link' \-\- 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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', mode: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' = \(aqw\(aq, chmod: \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' | \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' = None) -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.IO'\fI\%IO\fP\X'tty: link' Safely open a file. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBpath\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- Path to a file. .IP \(bu 2 \fBmode\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- Same os \fBmode\fP for \X'tty: link https://docs.python.org/3/library/functions.html#open'\fI\%open\fP\X'tty: link'\&. .IP \(bu 2 \fBchmod\fP (\X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link') \-\- 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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', chmod: \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' = 511, mode: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' = \(aqw\(aq) -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.Tuple'\fI\%Tuple\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/typing.html#typing.IO'\fI\%IO\fP\X'tty: link', \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'] Safely finds a unique file. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBpath\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- path/filename.ext .IP \(bu 2 \fBchmod\fP (\X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link') \-\- File mode .IP \(bu 2 \fBmode\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- 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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', filename: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', chmod: \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link' = 420, mode: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' = \(aqw\(aq) -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.Tuple'\fI\%Tuple\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/typing.html#typing.IO'\fI\%IO\fP\X'tty: link', \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'] Safely finds a unique file using lineage convention. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBpath\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- directory path .IP \(bu 2 \fBfilename\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- proposed filename .IP \(bu 2 \fBchmod\fP (\X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link') \-\- file mode .IP \(bu 2 \fBmode\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- 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 \X'tty: link https://docs.python.org/3/library/exceptions.html#OSError'\fI\%OSError\fP\X'tty: link' \-\- 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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' Remove a file that may not exist. .UNINDENT .INDENT 0.0 .TP .B certbot.util.get_filtered_names(all_names: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Set'\fI\%Set\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link']) -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.Set'\fI\%Set\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'] Removes names that aren\(aqt considered valid by Let\(aqs Encrypt. .INDENT 7.0 .TP .B Parameters \fBall_names\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#set'\fI\%set\fP\X'tty: link') \-\- all names found in the configuration .TP .B Returns all found names that are considered valid by LE .TP .B Return type \X'tty: link https://docs.python.org/3/library/stdtypes.html#set'\fI\%set\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.util.get_os_info() -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.Tuple'\fI\%Tuple\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'] Get OS name and version .INDENT 7.0 .TP .B Returns (os_name, os_version) .TP .B Return type \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link' of \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.util.get_os_info_ua() -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' Get OS name and version string for User Agent .INDENT 7.0 .TP .B Returns os_ua .TP .B Return type \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.util.get_systemd_os_like() -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.List'\fI\%List\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'] 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 \X'tty: link https://docs.python.org/3/library/stdtypes.html#list'\fI\%list\fP\X'tty: link' of \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.util.get_var_from_file(varname: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', filepath: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' = \(aq/etc/os\-release\(aq) -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- Name of variable to fetch .IP \(bu 2 \fBfilepath\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- File path of os\-release file .UNINDENT .TP .B Returns requested value .TP .B Return type \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.util.get_python_os_info(pretty: \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' = False) -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.Tuple'\fI\%Tuple\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link'] Get Operating System type/distribution and major version using python platform module .INDENT 7.0 .TP .B Parameters \fBpretty\fP (\X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link') \-\- If the returned OS name should be in longer (pretty) form .TP .B Returns (os_name, os_version) .TP .B Return type \X'tty: link https://docs.python.org/3/library/stdtypes.html#tuple'\fI\%tuple\fP\X'tty: link' of \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.util.safe_email(email: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' 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, deprecated=False) Bases: \X'tty: link https://docs.python.org/3/library/argparse.html#argparse.Action'\fI\%Action\fP\X'tty: link' .sp Action to log a warning when an argument is used. .UNINDENT .INDENT 0.0 .TP .B certbot.util.add_deprecated_argument(add_argument: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Callable'\fI\%Callable\fP\X'tty: link'[[\&...], \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link'], argument_name: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', nargs: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' | \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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 (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- 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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' Checks that Let\(aqs Encrypt will consider domain to be valid. .INDENT 7.0 .TP .B Parameters \fBdomain\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- FQDN to check .TP .B Returns The domain cast to \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', with ASCII\-only contents .TP .B Return type \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' .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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' | \X'tty: link https://docs.python.org/3/library/stdtypes.html#bytes'\fI\%bytes\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' Method which validates domain value and errors out if the requirements are not met. .INDENT 7.0 .TP .B Parameters \fBdomain\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' or \X'tty: link https://docs.python.org/3/library/stdtypes.html#bytes'\fI\%bytes\fP\X'tty: link') \-\- 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 \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link', with ASCII\-only contents .TP .B Return type \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.util.is_ipaddress(address: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' Is given address string form of IP(v4 or v6) address? .INDENT 7.0 .TP .B Parameters \fBaddress\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- address to check .TP .B Returns True if address is valid IP address, otherwise return False. .TP .B Return type \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.util.is_wildcard_domain(domain: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' | \X'tty: link https://docs.python.org/3/library/stdtypes.html#bytes'\fI\%bytes\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' \(dqIs domain a wildcard domain? .INDENT 7.0 .TP .B Parameters \fBdomain\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#bytes'\fI\%bytes\fP\X'tty: link' or \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- domain to check .TP .B Returns True if domain is a wildcard, otherwise, False .TP .B Return type \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' .UNINDENT .UNINDENT .INDENT 0.0 .TP .B certbot.util.is_staging(srv: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/functions.html#bool'\fI\%bool\fP\X'tty: link' Determine whether a given ACME server is a known test / staging server. .INDENT 7.0 .TP .B Parameters \fBsrv\fP (\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') \-\- 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: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Callable'\fI\%Callable\fP\X'tty: link', *args: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link', **kwargs: \X'tty: link https://docs.python.org/3/library/typing.html#typing.Any'\fI\%Any\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/constants.html#None'\fI\%None\fP\X'tty: link' 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: \X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link') -> \X'tty: link https://docs.python.org/3/library/typing.html#typing.List'\fI\%List\fP\X'tty: link'[\X'tty: link https://docs.python.org/3/library/stdtypes.html#str'\fI\%str\fP\X'tty: link' | \X'tty: link https://docs.python.org/3/library/functions.html#int'\fI\%int\fP\X'tty: link'] 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 \X'tty: link https://github.com/python/cpython/blob/v3.10.0/Lib/distutils/version.py#L205-L347'\fI\%https://github.com/python/cpython/blob/v3.10.0/Lib/distutils/version.py#L205\-L347\fP\X'tty: link'\&. :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-2018 - 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. .