Merge pull request #7009 from rigrassm/dns-rfc2136-config-changes

Make tsig algorithm configuration option in the certbot_dns_rfc2136 config file case insensitive
This commit is contained in:
schoen
2019-04-30 19:15:16 -07:00
committed by GitHub
3 changed files with 5 additions and 2 deletions
+3
View File
@@ -33,6 +33,9 @@ Certbot adheres to [Semantic Versioning](https://semver.org/).
--no-permissions-check.
* `acme` module uses now a POST-as-GET request to retrieve the registration
from an ACME v2 server
* Convert the tsig algorithm specified in the certbot_dns_rfc2136 configuration file to
all uppercase letters before validating. This makes the value in the config case
insensitive.
### Fixed
@@ -57,7 +57,7 @@ class Authenticator(dns_common.DNSAuthenticator):
def _validate_algorithm(self, credentials):
algorithm = credentials.conf('algorithm')
if algorithm:
if not self.ALGORITHMS.get(algorithm):
if not self.ALGORITHMS.get(algorithm.upper()):
raise errors.PluginError("Unknown algorithm: {0}.".format(algorithm))
def _setup_credentials(self):
@@ -64,7 +64,7 @@ class AuthenticatorTest(test_util.TempDirTestCase, dns_test_common.BaseAuthentic
def test_valid_algorithm_passes(self):
config = VALID_CONFIG.copy()
config["rfc2136_algorithm"] = "HMAC-SHA512"
config["rfc2136_algorithm"] = "HMAC-sha512"
dns_test_common.write(config, self.config.rfc2136_credentials)
self.auth.perform([self.achall])