From 0d90f20ed7407dc60c741ba0c17b6168a242d551 Mon Sep 17 00:00:00 2001 From: Alexandre Dulaunoy Date: Thu, 23 Apr 2015 13:59:00 +0200 Subject: [PATCH] Handle unset DN --- bin/x509/pcap-sslcert.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/x509/pcap-sslcert.py b/bin/x509/pcap-sslcert.py index 189cc2a..bb52bd4 100644 --- a/bin/x509/pcap-sslcert.py +++ b/bin/x509/pcap-sslcert.py @@ -73,7 +73,10 @@ for l in fileinput.input(args.r): if args.j: print (json.dumps(c)) elif args.f: - print (c['dstip']+","+c['fp']+","+x509.get_subject().CN) + subject = x509.get_subject().CN + if subject is None: + subject = "" + print (c['dstip']+","+c['fp']+","+subject elif args.s: print (c['fp']+","+base64.standard_b64encode(dercert)) else: