Skip to content

Commit

Permalink
Fixes #286: Changed misp client certificate validation config check
Browse files Browse the repository at this point in the history
  • Loading branch information
3c7 committed Jun 11, 2018
1 parent 9880c86 commit 08c59b6
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions analyzers/MISP/mispclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,25 @@ def __init__(self, url, key, ssl=True, name='Unnamed', proxies=None):
elif isinstance(ssl[idx], bool):
verify = ssl[idx]
else:
raise TypeError('SSL parameter is a not expected type.')
raise TypeError('SSL parameter is a not expected type: {}'.format(type(ssl[idx])))
# Do the same checks again, for the non-list type
elif isinstance(ssl, str):
if os.path.isfile(ssl):
verify = ssl
elif isinstance(ssl, bool):
verify = ssl
else:
raise TypeError('SSL parameter is a not expected type.')
raise TypeError('SSL parameter is a not expected type: {}'.format(type(ssl)))
self.misp_connections.append(pymisp.PyMISP(url=server,
key=key[idx],
ssl=verify,
proxies=proxies))
else:
verify = True
if isinstance(ssl, str):
if os.path.isfile(ssl):
verify = ssl
if isinstance(ssl, str) and os.path.isfile(ssl):
verify = ssl
elif isinstance(ssl, str):
raise CertificateNotFoundError('Certificate not found under {}.'.format(ssl))
elif isinstance(ssl, bool):
verify = ssl
self.misp_connections.append(pymisp.PyMISP(url=url,
Expand Down

0 comments on commit 08c59b6

Please sign in to comment.