mirror of
https://github.com/certbot/certbot.git
synced 2026-06-03 22:08:07 -04:00
Fix for revoke cert by key process
This commit is contained in:
parent
ab286e0887
commit
3a9150a7ba
1 changed files with 2 additions and 6 deletions
|
|
@ -247,13 +247,9 @@ def verify_cert_matches_priv_key(cert_path, key_path):
|
|||
:raises errors.Error: If they don't match.
|
||||
"""
|
||||
try:
|
||||
with open(cert_path) as cert:
|
||||
cert = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_PEM, cert.read())
|
||||
with open(key_path) as privkey:
|
||||
privkey = OpenSSL.crypto.load_privatekey(OpenSSL.crypto.FILETYPE_PEM, privkey.read())
|
||||
context = OpenSSL.SSL.Context(OpenSSL.SSL.SSLv23_METHOD)
|
||||
context.use_privatekey(privkey)
|
||||
context.use_certificate(cert)
|
||||
context.use_certificate_file(cert_path)
|
||||
context.use_privatekey_file(key_path)
|
||||
context.check_privatekey()
|
||||
except (IOError, OpenSSL.SSL.Error) as e:
|
||||
error_str = "verifying the cert located at {0} matches the \
|
||||
|
|
|
|||
Loading…
Reference in a new issue