Exemple #1
0
 def __create_lets(self, get):
     from acme_v2 import acme_v2
     site_id = str(
         public.M('sites').where('name=?', (get.domain, )).getField('id'))
     get.auth_type = 'http'
     get.auth_to = site_id
     get.id = site_id
     get.auto_wildcard = '0'
     get.domains = json.dumps([get.domain])
     cert_info = acme_v2().apply_cert_api(get)
     get.key = cert_info['private_key']
     get.csr = cert_info['cert'] + cert_info['root']
     return self._deploy_cert(get)
Exemple #2
0
 def __create_lets(self,get):
     from acme_v2 import acme_v2
     site_id = str(public.M('sites').where('name=?',(get.domain,)).getField('id'))
     get.auth_type = 'http'
     get.auth_to = site_id
     get.id = site_id
     get.auto_wildcard = '0'
     get.domains = json.dumps([get.domain])
     cert_info = acme_v2().apply_cert_api(get)
     if 'private_key' not in cert_info:
         return public.returnMsg(False, "Failed to apply for a certificate, please try to manually apply for a certificate for the panel domain name on the site management page")
     get.key = cert_info['private_key']
     get.csr = cert_info['cert'] + cert_info['root']
     return self._deploy_cert(get)