From bbbfc473d32963c2a7b52a67bf23573c06d04cdf Mon Sep 17 00:00:00 2001 From: "Jeff R. Allen" Date: Fri, 19 May 2017 22:54:00 +0200 Subject: [PATCH] Handle mixed case domains in CSRs (#4685) Lowercase domains from CSR, just like the domains from the command line are. Fixes #4684 --- certbot/cli.py | 4 +++- certbot/tests/crypto_util_test.py | 4 ++-- certbot/tests/testdata/csr.der | Bin 353 -> 281 bytes certbot/tests/testdata/csr.pem | 14 ++++++-------- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/certbot/cli.py b/certbot/cli.py index b0356db23..5053b77fa 100644 --- a/certbot/cli.py +++ b/certbot/cli.py @@ -620,7 +620,9 @@ class HelpfulArgumentParser(object): % parsed_args.csr[0]) parsed_args.actual_csr = (csr, typ) - csr_domains, config_domains = set(domains), set(parsed_args.domains) + + csr_domains = set([d.lower() for d in domains]) + config_domains = set(parsed_args.domains) if csr_domains != config_domains: raise errors.ConfigurationError( "Inconsistent domain requests:\nFrom the CSR: {0}\nFrom command line/config: {1}" diff --git a/certbot/tests/crypto_util_test.py b/certbot/tests/crypto_util_test.py index c83ad96b1..8adf753d6 100644 --- a/certbot/tests/crypto_util_test.py +++ b/certbot/tests/crypto_util_test.py @@ -163,7 +163,7 @@ class ImportCSRFileTest(unittest.TestCase): util.CSR(file=csrfile, data=data_pem, form="pem"), - ["example.com"],), + ["Example.com"],), self._call(csrfile, data)) def test_pem_csr(self): @@ -175,7 +175,7 @@ class ImportCSRFileTest(unittest.TestCase): util.CSR(file=csrfile, data=data, form="pem"), - ["example.com"],), + ["Example.com"],), self._call(csrfile, data)) def test_bad_csr(self): diff --git a/certbot/tests/testdata/csr.der b/certbot/tests/testdata/csr.der index 22900a6125aed31c9cfd1b6fe315c40dbd2fd99f..5c03f3a1114a9d0ad0899670c744efcbf0126685 100644 GIT binary patch delta 185 zcmaFJG?OXTpovk`pz#0`BZEP-A-4f18*?ZNn=q4OsG+cdAc(`k!xfyLo2naJl30>z zsAwP$66E5M@XRYoEy_zRQ3%gWNzW`PRtPAmRPZTDF%&Tn0x4nU;dY%^lNrolz{|#| z)#lOmotKf3o0Wmtk%3(UN-ar<_)FR?K>|cC!e8|frNn=P>HM{3%>zx6IfY6PO4sV zey#y8Tp=SjD+9A5Ly`NRca2;0qofT*IS%%v@A=!&;vT8<`n&vXYs=p)dvtP(4>Y_D gIO4