def enforce_le_validity(domain):
 domain = enforce_domain_sanity(domain)
 if (not re.match('^[A-Za-z0-9.-]*$', domain)):
  raise errors.ConfigurationError('{0} contains an invalid character. Valid characters are A-Z, a-z, 0-9, ., and -.'.format(domain))
 labels = domain.split('.')
 if (len(labels) < 2):
  raise errors.ConfigurationError('{0} needs at least two labels'.format(domain))
 for label in labels:
  if label.startswith('-'):
   raise errors.ConfigurationError('label "{0}" in domain "{1}" cannot start with "-"'.format(label, domain))
  if label.endswith('-'):
   raise errors.ConfigurationError('label "{0}" in domain "{1}" cannot end with "-"'.format(label, domain))
 return domain

def enforce_le_validity ( domain ) : domain = enforce_domain_sanity ( domain ) if ( not re . match ( '^[A-Za-z0-9.-]*$' , domain ) ) : raise errors . ConfigurationError ( '{0} contains an invalid character. Valid characters are A-Z, a-z, 0-9, ., and -.' . format ( domain ) ) labels = domain . split ( '.' ) if ( len ( labels ) < 2 ) : raise errors . ConfigurationError ( '{0} needs at least two labels' . format ( domain ) ) for label in labels : if label . startswith ( '-' ) : raise errors . ConfigurationError ( 'label "{0}" in domain "{1}" cannot start with "-"' . format ( label , domain ) ) if label . endswith ( '-' ) : raise errors . ConfigurationError ( 'label "{0}" in domain "{1}" cannot end with "-"' . format ( label , domain ) ) return domain
checks that lets encrypt will consider domain to be valid .