示例#1
0
    def activate_ssl(self, name, domain, plugin='default'):
        lb = LoadBalancer.find(name)
        if lb is None:
            raise storage.InstanceNotFoundError()

        if not self._check_dns(name, domain):
            raise SslError('rpaas IP is not registered for this DNS name')

        key = ssl.generate_key()
        csr = ssl.generate_csr(key, domain)

        if plugin == 'le':
            try:
                self.task_manager.create(name)
                task = tasks.DownloadCertTask().delay(self.config, name, plugin, csr, key, domain)
                self.task_manager.update(name, task.task_id)
                return ''
            except Exception:
                raise SslError('rpaas IP is not registered for this DNS name')

        else:
            p_ssl = ssl_plugins.default.Default(domain)
            cert = p_ssl.download_crt(key=key)
            self.update_certificate(name, cert, key)
            return ''
示例#2
0
文件: manager.py 项目: dmvieira/rpaas
    def activate_ssl(self, name, domain, plugin='default'):
        lb = LoadBalancer.find(name)
        if lb is None:
            raise storage.InstanceNotFoundError()

        if not self._check_dns(name, domain):
            raise SslError('rpaas IP is not registered for this DNS name')

        key = ssl.generate_key()
        csr = ssl.generate_csr(key, domain)

        if plugin == 'le':
            try:
                self.task_manager.create(name)
                task = tasks.DownloadCertTask().delay(self.config, name, plugin, csr, key, domain)
                self.task_manager.update(name, task.task_id)
                return ''
            except Exception:
                raise SslError('rpaas IP is not registered for this DNS name')

        else:
            p_ssl = ssl_plugins.default.Default(domain)
            cert = p_ssl.download_crt(key=key)
            self.update_certificate(name, cert, key)
            return ''
示例#3
0
 def renew(self, cert, config):
     key = ssl.generate_key()
     csr = ssl.generate_csr(key, cert["domain"])
     DownloadCertTask().delay(config=config, name=cert["name"], plugin="le",
                              csr=csr, key=key, domain=cert["domain"])
示例#4
0
文件: tasks.py 项目: vierno/rpaas
 def renew(self, cert, config):
     key = ssl.generate_key()
     csr = ssl.generate_csr(key, cert["domain"])
     DownloadCertTask().delay(config=config, name=cert["name"], plugin="le",
                              csr=csr, key=key, domain=cert["domain"])