def use_wildcard_certificate(bench_path, ret):
 from bench.config.common_site_config import get_config
 config = get_config(bench_path=bench_path)
 wildcard = config.get('wildcard')
 if (not wildcard):
  return
 domain = wildcard['domain']
 ssl_certificate = wildcard['ssl_certificate']
 ssl_certificate_key = wildcard['ssl_certificate_key']
 if domain.startswith('*.'):
  domain = domain[1:]
 else:
  domain = ('.' + domain)
 for site in ret:
  if site.get('ssl_certificate'):
   continue
  if (site.get('domain') or site['name']).endswith(domain):
   site['ssl_certificate'] = ssl_certificate
   site['ssl_certificate_key'] = ssl_certificate_key
   site['wildcard'] = 1

def use_wildcard_certificate ( bench_path , ret ) : from bench . config . common_site_config import get_config config = get_config ( bench_path = bench_path ) wildcard = config . get ( 'wildcard' ) if ( not wildcard ) : return domain = wildcard [ 'domain' ] ssl_certificate = wildcard [ 'ssl_certificate' ] ssl_certificate_key = wildcard [ 'ssl_certificate_key' ] if domain . startswith ( '*.' ) : domain = domain [ 1 : ] else : domain = ( '.' + domain ) for site in ret : if site . get ( 'ssl_certificate' ) : continue if ( site . get ( 'domain' ) or site [ 'name' ] ) . endswith ( domain ) : site [ 'ssl_certificate' ] = ssl_certificate site [ 'ssl_certificate_key' ] = ssl_certificate_key site [ 'wildcard' ] = 1
stored in common_site_config .