Skip to content

Commit

Permalink
Add IP Address
Browse files Browse the repository at this point in the history
  • Loading branch information
narbehaj committed Nov 5, 2023
1 parent 0c0820e commit 7f3c68d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ssl_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,14 @@ def get_cert_sans(self, x509cert):
san = san.replace(',', ';')
return san

def get_cert_info(self, host, cert):
def get_cert_info(self, host, cert, resolved_ip):
"""Get all the information about cert and create a JSON file."""
context = {}

cert_subject = cert.get_subject()

context['host'] = host
context['resolved_ip'] = resolved_ip
context['issued_to'] = cert_subject.CN
context['issued_o'] = cert_subject.O
context['issuer_c'] = cert.get_issuer().countryName
Expand Down Expand Up @@ -239,9 +240,8 @@ def show_result(self, user_args):
else:
cert, resolved_ip = self.get_cert(host, port)

context[host] = self.get_cert_info(host, cert)
context[host] = self.get_cert_info(host, cert, resolved_ip)
context[host]['tcp_port'] = int(port)
context[host]['resolved_ip'] = resolved_ip

# Analyze the certificate if enabled
if user_args.analyze:
Expand Down Expand Up @@ -388,4 +388,4 @@ def get_args(self, json_args={}):

if __name__ == '__main__':
SSLCheckerObject = SSLChecker()
SSLCheckerObject.show_result(SSLCheckerObject.get_args(json_args={}))
SSLCheckerObject.show_result(SSLCheckerObject.get_args(json_args={}))

0 comments on commit 7f3c68d

Please sign in to comment.