You are here

protected function Provision_Service_Certificate_LetsEncrypt::getDomainsString in Aegir HTTPS 7.3

Returns a string specifying the site names we'd like on the certificate.

An example would be "--domain example.com --domain www.example.com" where the former is the canonical name, and the latter is one possible alternate name.

1 call to Provision_Service_Certificate_LetsEncrypt::getDomainsString()
Provision_Service_Certificate_LetsEncrypt::generate_certificates in submodules/letsencrypt/drush/Provision/Service/Certificate/LetsEncrypt.php
Generate a self-signed certificate for the provided key.

File

submodules/letsencrypt/drush/Provision/Service/Certificate/LetsEncrypt.php, line 165

Class

Provision_Service_Certificate_LetsEncrypt
A LetsEncrypt implementation of the Certificate service type.

Code

protected function getDomainsString($context) {
  $canonical_name = $context->uri;
  $options_list = array(
    "--domain {$canonical_name}",
  );
  if (isset($context->aliases)) {
    foreach ($context->aliases as $alias) {
      if (!in_array("--domain {$alias}", $options_list)) {
        $options_list[] = "--domain {$alias}";
      }
    }
  }
  return implode(" ", $options_list);
}