mirror of
https://github.com/certbot/certbot.git
synced 2026-08-03 00:22:04 +02:00
Handle lineages that were upgraded from staging -> production
This commit is contained in:
+16
-7
@@ -396,13 +396,22 @@ def _avoid_invalidating_lineage(config, lineage, original_server):
|
|||||||
def _is_staging(srv):
|
def _is_staging(srv):
|
||||||
return srv == constants.STAGING_URI or "staging" in srv
|
return srv == constants.STAGING_URI or "staging" in srv
|
||||||
|
|
||||||
if _is_staging(config.server) and not _is_staging(original_server):
|
# Some lineages may have begun with --staging, but then had production certs
|
||||||
if not config.break_my_certs:
|
# added to them
|
||||||
names = ", ".join(lineage.names())
|
latest_cert = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_PEM,
|
||||||
raise errors.Error(
|
open(lineage.cert).read())
|
||||||
"You've asked to renew/replace a valid certificiate with "
|
# all our test certs are from happy hacker fake CA, though maybe one day
|
||||||
"a test certificate (domains: {0}). We will not do that "
|
# we should test more methodically
|
||||||
"unless you use the --break-my-certs flag!".format(names))
|
now_valid = not ("fake" in repr(latest_cert.get_issuer()).lower())
|
||||||
|
|
||||||
|
if _is_staging(config.server):
|
||||||
|
if not _is_staging(original_server) or now_valid:
|
||||||
|
if not config.break_my_certs:
|
||||||
|
names = ", ".join(lineage.names())
|
||||||
|
raise errors.Error(
|
||||||
|
"You've asked to renew/replace a seemingly valid certificiate with "
|
||||||
|
"a test certificate (domains: {0}). We will not do that "
|
||||||
|
"unless you use the --break-my-certs flag!".format(names))
|
||||||
|
|
||||||
def set_configurator(previously, now):
|
def set_configurator(previously, now):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user