mirror of
https://github.com/certbot/certbot.git
synced 2026-01-21 19:01:07 +03:00
Merge remote-tracking branch 'github/letsencrypt/master' into cli-config-fixes
Conflicts: letsencrypt/cli.py
This commit is contained in:
@@ -147,7 +147,7 @@ def install(args, config, plugins):
|
||||
acme, doms = _common_run(
|
||||
args, config, acc, authenticator=None, installer=installer)
|
||||
assert args.cert_path is not None # required=True in the subparser
|
||||
acme.deploy_certificate(doms, acc.key, args.cert_path, args.chain_path)
|
||||
acme.deploy_certificate(doms, acc.key.file, args.cert_path, args.chain_path)
|
||||
acme.enhance_config(doms, args.redirect)
|
||||
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ class Client(object):
|
||||
# TODO: Allow for other alg types besides RS256
|
||||
self.network = network2.Network(
|
||||
config.server, jwk.JWKRSA.load(self.account.key.pem),
|
||||
verify_ssl=config.no_verify_ssl)
|
||||
verify_ssl=(not config.no_verify_ssl))
|
||||
|
||||
self.config = config
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""Tests for letsencrypt.client."""
|
||||
import os
|
||||
import unittest
|
||||
import pkg_resources
|
||||
import shutil
|
||||
import tempfile
|
||||
|
||||
@@ -11,7 +12,33 @@ from letsencrypt import configuration
|
||||
from letsencrypt import le_util
|
||||
|
||||
|
||||
KEY = pkg_resources.resource_string(
|
||||
__name__, os.path.join("testdata", "rsa512_key.pem"))
|
||||
|
||||
|
||||
class ClientTest(unittest.TestCase):
|
||||
"""Tests for letsencrypt.client.Client."""
|
||||
|
||||
def setUp(self):
|
||||
self.config = mock.MagicMock(no_verify_ssl=False)
|
||||
# pylint: disable=star-args
|
||||
self.account = mock.MagicMock(**{"key.pem": KEY})
|
||||
|
||||
from letsencrypt.client import Client
|
||||
with mock.patch("letsencrypt.client.network2") as network2:
|
||||
self.client = Client(
|
||||
config=self.config, account_=self.account, dv_auth=None,
|
||||
installer=None)
|
||||
self.network2 = network2
|
||||
|
||||
def test_init_network_verify_ssl(self):
|
||||
self.network2.Network.assert_called_once_with(
|
||||
mock.ANY, mock.ANY, verify_ssl=True)
|
||||
|
||||
|
||||
class DetermineAccountTest(unittest.TestCase):
|
||||
"""Tests for letsencrypt.client.determine_authenticator."""
|
||||
|
||||
def setUp(self):
|
||||
self.accounts_dir = tempfile.mkdtemp("accounts")
|
||||
account_keys_dir = os.path.join(self.accounts_dir, "keys")
|
||||
@@ -54,7 +81,8 @@ class DetermineAccountTest(unittest.TestCase):
|
||||
|
||||
|
||||
class RollbackTest(unittest.TestCase):
|
||||
"""Test the rollback function."""
|
||||
"""Tests for letsencrypt.client.rollback."""
|
||||
|
||||
def setUp(self):
|
||||
self.m_install = mock.MagicMock()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user