certbot.plugins.common

Plugin common functions.

certbot.plugins.common.option_namespace(name)[source]

ArgumentParser options namespace (prefix of all options).

certbot.plugins.common.dest_namespace(name)[source]

ArgumentParser dest namespace (prefix of all destinations).

class certbot.plugins.common.Plugin(config, name)[source]

Bases: object

Generic plugin.

classmethod add_parser_arguments(add)[source]

Add plugin arguments to the CLI argument parser.

NOTE: If some of your flags interact with others, you can use cli.report_config_interaction to register this to ensure values are correctly saved/overridable during renewal.

Parameters:add (callable) – Function that proxies calls to argparse.ArgumentParser.add_argument prepending options with unique plugin name prefix.
classmethod inject_parser_options(parser, name)[source]

Inject parser options.

See inject_parser_options for docs.

option_namespace

ArgumentParser options namespace (prefix of all options).

option_name(name)[source]

Option name (include plugin namespace).

dest_namespace

ArgumentParser dest namespace (prefix of all destinations).

dest(var)[source]

Find a destination for given variable var.

conf(var)[source]

Find a configuration value for variable var.

class certbot.plugins.common.Addr(tup, ipv6=False)[source]

Bases: object

Represents an virtual host address.

Parameters:
  • addr (str) – addr part of vhost address
  • port (str) – port number or *, or “”
classmethod fromstring(str_addr)[source]

Initialize Addr from string.

normalized_tuple()[source]

Normalized representation of addr/port tuple

get_addr()[source]

Return addr part of Addr object.

get_port()[source]

Return port.

get_addr_obj(port)[source]

Return new address object with same addr and new port.

_normalize_ipv6(addr)[source]

Return IPv6 address in normalized form, helper function

get_ipv6_exploded()[source]

Return IPv6 in normalized form

_explode_ipv6(addr)[source]

Explode IPv6 address for comparison

class certbot.plugins.common.TLSSNI01(configurator)[source]

Bases: object

Abstract base for TLS-SNI-01 challenge performers

add_chall(achall, idx=None)[source]

Add challenge to TLSSNI01 object to perform at once.

Parameters:
get_cert_path(achall)[source]

Returns standardized name for challenge certificate.

Parameters:achall (KeyAuthorizationAnnotatedChallenge) – Annotated tls-sni-01 challenge.
Returns:certificate file name
Return type:str
get_key_path(achall)[source]

Get standardized path to challenge key.

_setup_challenge_cert(achall, cert_key=None)[source]

Generate and write out challenge certificate.

certbot.plugins.common.setup_ssl_options(config_dir, src, dest)[source]

Move the ssl_options into position and return the path.

certbot.plugins.common.dir_setup(test_dir, pkg)[source]

Setup the directories necessary for the configurator.