From ab10d41c19feea2b3b1212a369675e6d664ca030 Mon Sep 17 00:00:00 2001 From: Alexandre Dulaunoy Date: Fri, 2 Oct 2015 20:17:12 +0000 Subject: [PATCH] ICSI data added in the JSON output --- bin/x509/ip-ssl-subject-api.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bin/x509/ip-ssl-subject-api.py b/bin/x509/ip-ssl-subject-api.py index d118e48..4b2574c 100644 --- a/bin/x509/ip-ssl-subject-api.py +++ b/bin/x509/ip-ssl-subject-api.py @@ -130,9 +130,15 @@ class FetchCertificateHandler(tornado.web.RequestHandler): try: r = redis.StrictRedis(host='127.0.0.1', port=8323) except: - print "Unable to connect to the Redis server" + print ("Unable to connect to the Redis server") sys.exit(255) + #ICSI data + try: + ricsi = redis.StrictRedis(host='localhost', port=6380, db=5) + except: + print ("Unable to connect to the Redis ICSI notary server") + fp = input.lower() if not checksha1(value=fp): self.clear() @@ -163,7 +169,9 @@ class FetchCertificateHandler(tornado.web.RequestHandler): for i in range(0, extcount): out['info']['extension'][cert.get_ext_at(i).get_name()] = cert.get_ext_at(i).get_value() - + if ricsi.exists(fp): + icsi = ricsi.hgetall(fp) + out['icsi'] = icsi if not self._finished: self.set_header('Content-Type', 'application/json') self.set_header('Server', servername)