diff --git a/letsencrypt-apache/letsencrypt_apache/dvsni.py b/letsencrypt-apache/letsencrypt_apache/dvsni.py index 93fbea57e..d1d4ca524 100644 --- a/letsencrypt-apache/letsencrypt_apache/dvsni.py +++ b/letsencrypt-apache/letsencrypt_apache/dvsni.py @@ -164,7 +164,7 @@ class ApacheDvsni(common.Dvsni): # https://docs.python.org/2.7/reference/lexical_analysis.html return self.VHOST_TEMPLATE.format( vhost=ips, - server_name=achall.gen_response(achall.account.key).z_domain, + server_name=achall.gen_response(achall.account_key).z_domain, ssl_options_conf_path=self.configurator.mod_ssl_conf, cert_path=self.get_cert_path(achall), key_path=self.get_key_path(achall), diff --git a/letsencrypt-apache/letsencrypt_apache/tests/configurator_test.py b/letsencrypt-apache/letsencrypt_apache/tests/configurator_test.py index bbccff239..6d16474b3 100644 --- a/letsencrypt-apache/letsencrypt_apache/tests/configurator_test.py +++ b/letsencrypt-apache/letsencrypt_apache/tests/configurator_test.py @@ -376,8 +376,8 @@ class TwoVhost80Test(util.ApacheTest): account_key, achall1, achall2 = self.get_achalls() dvsni_ret_val = [ - achall1.gen_response(account_key.key), - achall2.gen_response(account_key.key), + achall1.gen_response(account_key), + achall2.gen_response(account_key), ] mock_dvsni_perform.return_value = dvsni_ret_val @@ -584,21 +584,21 @@ class TwoVhost80Test(util.ApacheTest): def get_achalls(self): """Return testing achallenges.""" - account = mock.MagicMock(key=self.rsa512jwk) + account_key = self.rsa512jwk achall1 = achallenges.DVSNI( challb=acme_util.chall_to_challb( challenges.DVSNI( token="jIq_Xy1mXGN37tb4L6Xj_es58fW571ZNyXekdZzhh7Q"), "pending"), - domain="encryption-example.demo", account=account) + domain="encryption-example.demo", account_key=account_key) achall2 = achallenges.DVSNI( challb=acme_util.chall_to_challb( challenges.DVSNI( token="uqnaPzxtrndteOqtrXb0Asl5gOJfWAnnx6QJyvcmlDU"), "pending"), - domain="letsencrypt.demo", account=account) + domain="letsencrypt.demo", account_key=account_key) - return account, achall1, achall2 + return account_key, achall1, achall2 def test_make_addrs_sni_ready(self): self.config.version = (2, 2) diff --git a/letsencrypt-nginx/letsencrypt_nginx/dvsni.py b/letsencrypt-nginx/letsencrypt_nginx/dvsni.py index 3ac5e788f..bd9ca783f 100644 --- a/letsencrypt-nginx/letsencrypt_nginx/dvsni.py +++ b/letsencrypt-nginx/letsencrypt_nginx/dvsni.py @@ -133,7 +133,7 @@ class NginxDvsni(common.Dvsni): block = [['listen', str(addr)] for addr in addrs] block.extend([['server_name', - achall.gen_response(achall.account.key).z_domain], + achall.gen_response(achall.account_key).z_domain], ['include', self.configurator.parser.loc["ssl_options"]], # access and error logs necessary for # integration testing (non-root) diff --git a/letsencrypt-nginx/letsencrypt_nginx/tests/configurator_test.py b/letsencrypt-nginx/letsencrypt_nginx/tests/configurator_test.py index 0f92a387c..977a65330 100644 --- a/letsencrypt-nginx/letsencrypt_nginx/tests/configurator_test.py +++ b/letsencrypt-nginx/letsencrypt_nginx/tests/configurator_test.py @@ -173,23 +173,22 @@ class NginxConfiguratorTest(util.NginxTest): def test_perform(self, mock_restart, mock_dvsni_perform): # Only tests functionality specific to configurator.perform # Note: As more challenges are offered this will have to be expanded - account = mock.MagicMock(key=self.rsa512jwk) achall1 = achallenges.DVSNI( challb=messages.ChallengeBody( chall=challenges.DVSNI(token="kNdwjwOeX0I_A8DXt9Msmg"), uri="https://ca.org/chall0_uri", status=messages.Status("pending"), - ), domain="localhost", account=account) + ), domain="localhost", account_key=self.rsa512jwk) achall2 = achallenges.DVSNI( challb=messages.ChallengeBody( chall=challenges.DVSNI(token="m8TdO1qik4JVFtgPPurJmg"), uri="https://ca.org/chall1_uri", status=messages.Status("pending"), - ), domain="example.com", account=account) + ), domain="example.com", account_key=self.rsa512jwk) dvsni_ret_val = [ - achall1.gen_response(account.key), - achall2.gen_response(account.key), + achall1.gen_response(self.rsa512jwk), + achall2.gen_response(self.rsa512jwk), ] mock_dvsni_perform.return_value = dvsni_ret_val diff --git a/letsencrypt-nginx/letsencrypt_nginx/tests/dvsni_test.py b/letsencrypt-nginx/letsencrypt_nginx/tests/dvsni_test.py index b1612a097..a164397b6 100644 --- a/letsencrypt-nginx/letsencrypt_nginx/tests/dvsni_test.py +++ b/letsencrypt-nginx/letsencrypt_nginx/tests/dvsni_test.py @@ -19,26 +19,26 @@ from letsencrypt_nginx.tests import util class DvsniPerformTest(util.NginxTest): """Test the NginxDVSNI challenge.""" - account = mock.MagicMock(key=common_test.DvsniTest.auth_key) + account_key = common_test.DvsniTest.auth_key achalls = [ achallenges.DVSNI( challb=acme_util.chall_to_challb( challenges.DVSNI(token="kNdwjwOeX0I_A8DXt9Msmg"), "pending"), - domain="www.example.com", account=account), + domain="www.example.com", account_key=account_key), achallenges.DVSNI( challb=acme_util.chall_to_challb( challenges.DVSNI( token="\xba\xa9\xda?