Merge pull request #7 from jpmens/json_fix
Fix JSON (-j) and (-j -p) output to produce
This commit is contained in:
commit
af29641bcd
@ -7,6 +7,7 @@ from datetime import datetime
|
|||||||
from ssl import PROTOCOL_TLSv1
|
from ssl import PROTOCOL_TLSv1
|
||||||
from time import sleep
|
from time import sleep
|
||||||
from csv import DictWriter
|
from csv import DictWriter
|
||||||
|
import json
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from OpenSSL import SSL
|
from OpenSSL import SSL
|
||||||
@ -55,7 +56,6 @@ def border_msg(message):
|
|||||||
|
|
||||||
def analyze_ssl(host, context):
|
def analyze_ssl(host, context):
|
||||||
"""Analyze the security of the SSL certificate."""
|
"""Analyze the security of the SSL certificate."""
|
||||||
from json import loads
|
|
||||||
try:
|
try:
|
||||||
from urllib.request import urlopen
|
from urllib.request import urlopen
|
||||||
except ImportError:
|
except ImportError:
|
||||||
@ -223,9 +223,9 @@ def show_result(user_args):
|
|||||||
if user_args.json_true:
|
if user_args.json_true:
|
||||||
if user_args.pretty_output:
|
if user_args.pretty_output:
|
||||||
from pprint import pprint
|
from pprint import pprint
|
||||||
pprint(context)
|
print(json.dumps(context, indent=4))
|
||||||
else:
|
else:
|
||||||
print(context)
|
print(json.dumps(context))
|
||||||
|
|
||||||
|
|
||||||
def export_csv(context, filename):
|
def export_csv(context, filename):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user