# `letsencrypt_apache.tls_sni_01`

A class that performs TLS-SNI-01 challenges for Apache

class `letsencrypt_apache.tls_sni_01.``ApacheTlsSni01`(*args, **kwargs)

  Bases: `letsencrypt.plugins.common.TLSSNI01`

  Class that performs TLS-SNI-01 challenges within the Apache configurator

  Variables:

  - configurator – ApacheConfigurator object
  - achalls (list) – Annotated TLS-SNI-01 (`KeyAuthorizationAnnotatedChallenge`) challenges.

  Parameters:

  - indices (list) – Meant to hold indices of challenges in a larger array. ApacheTlsSni01 is capable of solving many challenges at once which causes an indexing issue within ApacheConfigurator who must return all responses in order. Imagine ApacheConfigurator maintaining state about where all of the http-01 Challenges, TLS-SNI-01 Challenges belong in the response array. This is an optional utility.
  - challenge_conf (str) – location of the challenge config file

  `perform`()

    Perform a TLS-SNI-01 challenge.

  `_mod_config`()

    Modifies Apache config files to include challenge vhosts.

    Result: Apache config includes virtual servers for issued challs

    Returns: | All TLS-SNI-01 addresses used
    Return type: | set

  `_get_addrs`(achall)

    Return the Apache addresses needed for TLS-SNI-01.

  `_conf_include_check`(main_config)

    Add TLS-SNI-01 challenge conf file into configuration.

    Adds TLS-SNI-01 challenge include file if it does not already exist within mainConfig

    Parameters: | main_config (str) – file path to main user apache config file

  `_get_config_text`(achall, ip_addrs)

    Chocolate virtual server configuration text

    Parameters:

    - achall (KeyAuthorizationAnnotatedChallenge) – Annotated TLS-SNI-01 challenge.
    - ip_addrs (list) – addresses of challenged domain `list` of type `Addr`

    Returns: | virtual host configuration text
    Return type: | str