mirror of
https://github.com/certbot/certbot.git
synced 2026-07-27 16:19:11 +02:00
Merge remote-tracking branch 'origin/master' into non-interactive
(Merge conflict due to PEP8iness)
This commit is contained in:
@@ -150,7 +150,7 @@ class Authenticator(common.Plugin):
|
||||
|
||||
# one self-signed key for all tls-sni-01 certificates
|
||||
self.key = OpenSSL.crypto.PKey()
|
||||
self.key.generate_key(OpenSSL.crypto.TYPE_RSA, bits=2048)
|
||||
self.key.generate_key(OpenSSL.crypto.TYPE_RSA, 2048)
|
||||
|
||||
self.served = collections.defaultdict(set)
|
||||
|
||||
|
||||
@@ -98,8 +98,8 @@ to serve all files under specified web root ({0})."""
|
||||
def _path_for_achall(self, achall):
|
||||
try:
|
||||
path = self.full_roots[achall.domain]
|
||||
except IndexError:
|
||||
raise errors.PluginError("Missing --webroot-path for domain: {1}"
|
||||
except KeyError:
|
||||
raise errors.PluginError("Missing --webroot-path for domain: {0}"
|
||||
.format(achall.domain))
|
||||
if not os.path.exists(path):
|
||||
raise errors.PluginError("Mysteriously missing path {0} for domain: {1}"
|
||||
|
||||
@@ -111,6 +111,18 @@ class AuthenticatorTest(unittest.TestCase):
|
||||
self.assertEqual(os.stat(self.validation_path).st_gid, parent_gid)
|
||||
self.assertEqual(os.stat(self.validation_path).st_uid, parent_uid)
|
||||
|
||||
def test_perform_missing_path(self):
|
||||
self.auth.prepare()
|
||||
|
||||
missing_achall = achallenges.KeyAuthorizationAnnotatedChallenge(
|
||||
challb=acme_util.HTTP01_P, domain="thing2.com", account_key=KEY)
|
||||
self.assertRaises(
|
||||
errors.PluginError, self.auth.perform, [missing_achall])
|
||||
|
||||
self.auth.full_roots[self.achall.domain] = 'null'
|
||||
self.assertRaises(
|
||||
errors.PluginError, self.auth.perform, [self.achall])
|
||||
|
||||
def test_perform_cleanup(self):
|
||||
self.auth.prepare()
|
||||
responses = self.auth.perform([self.achall])
|
||||
|
||||
Reference in New Issue
Block a user