mirror of
https://github.com/certbot/certbot.git
synced 2026-05-28 04:34:11 -04:00
Use correct key/cert for revoke by key test
This commit is contained in:
parent
3a9150a7ba
commit
368beee8bf
2 changed files with 7 additions and 3 deletions
|
|
@ -255,6 +255,8 @@ class VerifyCertMatchesPrivKeyTest(VerifyCertSetup):
|
|||
return verify_cert_matches_priv_key(renewable_cert.cert, renewable_cert.privkey)
|
||||
|
||||
def test_cert_priv_key_match(self):
|
||||
self.renewable_cert.cert = SS_CERT_PATH
|
||||
self.renewable_cert.privkey = RSA2048_KEY_PATH
|
||||
self.assertEqual(None, self._call(self.renewable_cert))
|
||||
|
||||
def test_cert_priv_key_mismatch(self):
|
||||
|
|
|
|||
|
|
@ -37,6 +37,8 @@ CERT = test_util.vector_path('cert.pem')
|
|||
CSR = test_util.vector_path('csr.der')
|
||||
KEY = test_util.vector_path('rsa256_key.pem')
|
||||
JWK = jose.JWKRSA.load(test_util.load_vector("rsa512_key_2.pem"))
|
||||
RSA2048_KEY_PATH = test_util.vector_path('rsa2048_key.pem')
|
||||
SS_CERT_PATH = test_util.vector_path('self_signed_cert.pem')
|
||||
|
||||
|
||||
class TestHandleIdenticalCerts(unittest.TestCase):
|
||||
|
|
@ -1012,12 +1014,12 @@ class MainTest(test_util.TempDirTestCase): # pylint: disable=too-many-public-me
|
|||
@mock.patch('certbot.main.client.acme_client')
|
||||
def test_revoke_with_key(self, mock_acme_client):
|
||||
server = 'foo.bar'
|
||||
self._call_no_clientmock(['--cert-path', CERT, '--key-path', KEY,
|
||||
self._call_no_clientmock(['--cert-path', SS_CERT_PATH, '--key-path', RSA2048_KEY_PATH,
|
||||
'--server', server, 'revoke'])
|
||||
with open(KEY, 'rb') as f:
|
||||
with open(RSA2048_KEY_PATH, 'rb') as f:
|
||||
mock_acme_client.Client.assert_called_once_with(
|
||||
server, key=jose.JWK.load(f.read()), net=mock.ANY)
|
||||
with open(CERT, 'rb') as f:
|
||||
with open(SS_CERT_PATH, 'rb') as f:
|
||||
cert = crypto_util.pyopenssl_load_certificate(f.read())[0]
|
||||
mock_revoke = mock_acme_client.Client().revoke
|
||||
mock_revoke.assert_called_once_with(
|
||||
|
|
|
|||
Loading…
Reference in a new issue