Skip to content

Commit

Permalink
Version 0.48. See CHANGELOG.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Git committed Aug 13, 2023
1 parent d313699 commit 47ec8bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
## Version 0.48
### Fixes
* Fixing certificate handling when setting the SSL context with the correct chain.
* Cleaning up redundant code. Aligning code with better python practices.

## Version 0.47
### Enhancements
Expand Down
14 changes: 4 additions & 10 deletions certificate/getCertificateChain.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Description: Get the certificate chain from a website.
# Author: TheScriptGuy
# Last modified: 2023-07-29
# Version: 0.04
# Last modified: 2023-08-13
# Version: 0.05

import ssl
import socket
Expand Down Expand Up @@ -258,10 +258,7 @@ def writeChainToFile(self, __certificateChain: dict) -> None:
myCertChain.pop(0)

# Iterate through all the elements in the chain.
for counter, certificateItem in enumerate(myCertChain):
# Get the subject from the certificate.
certSubject = certificateItem.subject.rfc4514_string()

for _, certificateItem in enumerate(myCertChain):
# Generate the certificate file name
sslCertificateFilename = f'{self.certificateHash}.pem'

Expand All @@ -283,9 +280,6 @@ def getCertificateChain(self, __hostname: str, __port: int):
# Get the AIA from the __websiteCertificate object
aia = self.returnCertAIA(__websiteCertificate)
if aia is not None:
# Extract the AIA URI list from the __websiteCertificate object.
aiaUriList = self.returnCertAIAList(__websiteCertificate)

# Append the __websiteCertificate object to the certChain list.
self.certChain.append(__websiteCertificate)

Expand All @@ -300,7 +294,7 @@ def getCertificateChain(self, __hostname: str, __port: int):

def __init__(self):
"""Init the getCertChain class."""
self.classVersion = "0.04"
self.classVersion = "0.05"
self.maxDepth = 4
self.certChain = []
self.certificateHash = ""

0 comments on commit 47ec8bc

Please sign in to comment.