mirror of
https://github.com/certbot/certbot.git
synced 2026-07-31 10:26:06 +02:00
handle invalid key sizes in a helpful way
This commit is contained in:
@@ -339,10 +339,12 @@ def init_key(key_size):
|
||||
the namedtuple to easily work with the protocol.
|
||||
|
||||
"""
|
||||
if key_size < CONFIG.RSA_KEY_SIZE:
|
||||
logging.warning("Generating keys smaller than %d bits is NOT recommended!", CONFIG.RSA_KEY_SIZE)
|
||||
|
||||
key_pem = crypto_util.make_key(key_size)
|
||||
try:
|
||||
key_pem = crypto_util.make_key(key_size)
|
||||
except ValueError as err:
|
||||
logging.fatal(str(err))
|
||||
logging.info("Note: The default RSA key size is %d bits." % CONFIG.RSA_KEY_SIZE)
|
||||
sys.exit(1)
|
||||
|
||||
# Save file
|
||||
le_util.make_or_verify_dir(CONFIG.KEY_DIR, 0o700)
|
||||
|
||||
Reference in New Issue
Block a user