Exemplo n.º 1
0
 def _get_snakeoil_paths(self):
     # TODO: generate only once
     tmp_dir = os.path.join(self.config.work_dir, "snakeoil")
     key = crypto_util.init_save_key(
         key_size=1024, key_dir=tmp_dir, keyname="key.pem")
     cert_pem = crypto_util.make_ss_cert(
         key.pem, domains=[socket.gethostname()])
     cert = os.path.join(tmp_dir, "cert.pem")
     with open(cert, 'w') as cert_file:
         cert_file.write(cert_pem)
     return cert, key.file
Exemplo n.º 2
0
 def _get_snakeoil_paths(self):
     # TODO: generate only once
     tmp_dir = os.path.join(self.config.work_dir, "snakeoil")
     key = crypto_util.init_save_key(key_size=1024,
                                     key_dir=tmp_dir,
                                     keyname="key.pem")
     cert_pem = crypto_util.make_ss_cert(key.pem,
                                         domains=[socket.gethostname()])
     cert = os.path.join(tmp_dir, "cert.pem")
     with open(cert, 'w') as cert_file:
         cert_file.write(cert_pem)
     return cert, key.file
Exemplo n.º 3
0
    def gen_cert_and_response(self, s=None):  # pylint: disable=invalid-name
        """Generate a DVSNI cert and save it to filepath.

        :returns: ``(cert_pem, response)`` tuple,  where ``cert_pem`` is the PEM
            encoded  certificate and ``response`` is an instance
            :class:`acme.challenges.DVSNIResponse`.
        :rtype: tuple

        """
        response = challenges.DVSNIResponse(s=s)
        cert_pem = crypto_util.make_ss_cert(self.key.pem, [
            self.nonce_domain, self.domain, response.z_domain(self.challb)])
        return cert_pem, response
    def gen_cert_and_response(self, s=None):  # pylint: disable=invalid-name
        """Generate a DVSNI cert and save it to filepath.

        :returns: ``(cert_pem, response)`` tuple,  where ``cert_pem`` is the PEM
            encoded  certificate and ``response`` is an instance
            :class:`acme.challenges.DVSNIResponse`.
        :rtype: tuple

        """
        response = challenges.DVSNIResponse(s=s)
        cert_pem = crypto_util.make_ss_cert(
            self.key.pem,
            [self.nonce_domain, self.domain,
             response.z_domain(self.challb)])
        return cert_pem, response
Exemplo n.º 5
0
 def test_it(self):  # pylint: disable=no-self-use
     from letsencrypt.crypto_util import make_ss_cert
     make_ss_cert(RSA512_KEY, ['example.com', 'www.example.com'])
Exemplo n.º 6
0
 def test_it(self):  # pylint: disable=no-self-use
     from letsencrypt.crypto_util import make_ss_cert
     make_ss_cert(RSA512_KEY, ['example.com', 'www.example.com'])