Exemplo n.º 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 ''
Exemplo n.º 2
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 ''
Exemplo n.º 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"])
Exemplo n.º 4
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"])