Log warning about TLS-SNI deprecation in Certbot (#6468)

For #6319.

* print warning in auth_handler

* add test
This commit is contained in:
ohemorange
2018-11-05 15:01:16 -08:00
committed by Brad Warren
parent cb8dd8a428
commit cbdc2ee23b
2 changed files with 11 additions and 0 deletions
+6
View File
@@ -113,6 +113,12 @@ class AuthHandler(object):
aauthzr.authzr, path)
aauthzr.achalls.extend(aauthzr_achalls)
for aauthzr in aauthzrs:
for achall in aauthzr.achalls:
if isinstance(achall.chall, challenges.TLSSNI01):
logger.warning("TLS-SNI-01 is deprecated, and will stop working soon.")
return
def _has_challenges(self, aauthzrs):
"""Do we have any challenges to perform?"""
return any(aauthzr.achalls for aauthzr in aauthzrs)
+5
View File
@@ -327,6 +327,11 @@ class HandleAuthorizationsTest(unittest.TestCase):
azr.body.combinations)
aauthzrs[i] = type(aauthzr)(updated_azr, aauthzr.achalls)
@mock.patch("certbot.auth_handler.logger")
def test_tls_sni_logs(self, logger):
self._test_name1_tls_sni_01_1_common(combos=True)
self.assertTrue("deprecated" in logger.warning.call_args[0][0])
class PollChallengesTest(unittest.TestCase):
# pylint: disable=protected-access