summaryrefslogtreecommitdiff
path: root/monitor
diff options
context:
space:
mode:
authorJosef Gustafsson <josef.gson@gmail.com>2015-09-10 14:47:24 +0200
committerJosef Gustafsson <josef.gson@gmail.com>2015-09-10 14:47:24 +0200
commitc7a4e747cda24b1d500becbb0c836e86ae537290 (patch)
tree680b13fdaa25a9ec502ca5ca868a344d07742e55 /monitor
parent44bbef43af1337c7aa56b0b10fa6344ae8e562f6 (diff)
bugfix: including SAN
Diffstat (limited to 'monitor')
-rwxr-xr-xmonitor/josef_leveldb.py13
1 files changed, 3 insertions, 10 deletions
diff --git a/monitor/josef_leveldb.py b/monitor/josef_leveldb.py
index 9557bb2..e5bf581 100755
--- a/monitor/josef_leveldb.py
+++ b/monitor/josef_leveldb.py
@@ -10,7 +10,6 @@ SEP = ";"
def match_domain(d1, d2):
- # print d1, d2
# Exact match
if d1 == d2:
return True
@@ -20,12 +19,10 @@ def match_domain(d1, d2):
d2l = d2.split('.')
if d1l[0] == '*':
- # print d1l[1:], d2l[-(len(d1l)-1):]
if d1l[1:] == d2l[-(len(d1l)-1):]:
return True
if d2l[0] == '*':
- # print d2l[1:], d1l[-(len(d2l)-1):]
if d2l[1:] == d1l[-(len(d2l)-1):]:
return True
@@ -75,20 +72,16 @@ def db_add_certs(db, data):
if db is None:
print "ERROR: NO DATABASE SET!"
return
- # print data, type(data)
- # batch = leveldb.WriteBatch()
for cert in data:
try:
db_add_domain(db, cert["subject"].split("CN=")[1], str(cert))
except IndexError:
pass
- # try:
+ try:
for line in cert["SAN"].split("DNS:")[1:]:
db_add_domain(db, line, str(cert))
- # except:
- # # print "Failed adding SAN in " + str(cert)
- # pass
- # db.Write(batch, sync = True)
+ except IndexError:
+ pass