chg: Add support to timeout in the MISP module

pull/165/head
Raphaël Vinot 2021-02-01 13:01:44 +01:00
parent dca06bd272
commit f017ef5bef
2 changed files with 3 additions and 1 deletions

View File

@ -14,6 +14,7 @@
"apikey": null,
"url": "https://misp.url",
"verify_tls_cert": true,
"timeout": 10,
"enable_lookup": false,
"enable_push": false
},

View File

@ -33,7 +33,8 @@ class MISP():
self.enable_lookup = False
self.enable_push = False
try:
self.client = PyMISP(url=config['url'], key=config['apikey'], ssl=config['verify_tls_cert'])
self.client = PyMISP(url=config['url'], key=config['apikey'],
ssl=config['verify_tls_cert'], timeout=config['timeout'])
except Exception as e:
self.available = False
self.logger.warning(f'Unable to connect to MISP: {e}')