Verified Commit b76208bf authored by Martin Petráček's avatar Martin Petráček
Browse files

monitor.py: fix error for self-signed certificates (missing CN)

parent 0e98bfa5
......@@ -53,9 +53,8 @@ def handle_tls(data, c):
if 'sni' in data['tls'].keys():
hostname = data['tls']['sni']
elif 'subject' in data['tls'].keys():
hostname = data['tls']['subject']
#get only CN from suject
m = re.search('(?<=CN=)[^,]*', hostname)
m = re.search('(?<=CN=)[^,]*', data['tls']['subject'])
if m:
hostname = m.group(0)
if not hostname:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment