Skip to content
Snippets Groups Projects
Unverified Commit 2816d3dc authored by Max Adamo's avatar Max Adamo
Browse files

update image link in README

parent 59016f80
No related branches found
No related tags found
No related merge requests found
# A tool to manage certificates lifecycle on Vault, Redis, Consul # A tool to manage certificates lifecycle on Vault, Redis, Consul
![Wile Coyote](https://filesender.geant.org/images/wile_coyote.jpg "Wile coyote") ![Wile Coyote](https://cds.geant.org/images/wile_coyote.jpg "Wile coyote")
## Install the package ## Install the package
......
...@@ -38,8 +38,9 @@ else: ...@@ -38,8 +38,9 @@ else:
def inspect_certificate(cert): def inspect_certificate(cert):
""" extract data from certificate """ """ extract data from the certificate """
pem_data = open(os.path.join(cert, 'fullchain.pem'), "rb").read() with open(os.path.join(cert, 'fullchain.pem'), "rb") as pem_file:
pem_data = pem_file.read()
cert = x509.load_pem_x509_certificate(pem_data, default_backend()) cert = x509.load_pem_x509_certificate(pem_data, default_backend())
cert_name = cert.subject.get_attributes_for_oid(x509.OID_COMMON_NAME)[0].value.strip() cert_name = cert.subject.get_attributes_for_oid(x509.OID_COMMON_NAME)[0].value.strip()
serial_raw = f'{cert.serial_number:x}'.upper() serial_raw = f'{cert.serial_number:x}'.upper()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment