mirror of
https://github.com/certbot/certbot.git
synced 2026-07-28 00:35:50 +02:00
Read in bytes to fix --reuse-key on Python 3 (#6069)
* Read bytes for now for compatibility * add clarifying comment
This commit is contained in:
+4
-1
@@ -299,7 +299,10 @@ class Client(object):
|
||||
# We've been asked to reuse a specific existing private key.
|
||||
# Therefore, we'll read it now and not generate a new one in
|
||||
# either case below.
|
||||
with open(old_keypath, "r") as f:
|
||||
#
|
||||
# We read in bytes here because the type of `key.pem`
|
||||
# created below is also bytes.
|
||||
with open(old_keypath, "rb") as f:
|
||||
keypath = old_keypath
|
||||
keypem = f.read()
|
||||
key = util.Key(file=keypath, pem=keypem) # type: Optional[util.Key]
|
||||
|
||||
Reference in New Issue
Block a user