From a1a524c2c55eb035c5bacb65ee38130b90444e06 Mon Sep 17 00:00:00 2001 From: Richard van den Berg Date: Fri, 26 Aug 2016 09:11:01 +0200 Subject: [PATCH] Add ssl client certificate support --- pymisp/api.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pymisp/api.py b/pymisp/api.py index d40cb04..c89f3ae 100644 --- a/pymisp/api.py +++ b/pymisp/api.py @@ -106,7 +106,7 @@ class PyMISP(object): threat_level = threat_level analysis = analysis - def __init__(self, url, key, ssl=True, out_type='json', debug=False, proxies=None): + def __init__(self, url, key, ssl=True, out_type='json', debug=False, proxies=None, cert=None): if not url: raise NoURL('Please provide the URL of your MISP instance.') if not key: @@ -116,6 +116,7 @@ class PyMISP(object): self.key = key self.ssl = ssl self.proxies = proxies + self.cert = cert if out_type != 'json': raise PyMISPError('The only output type supported by PyMISP is JSON. If you still rely on XML, use PyMISP v2.4.49') self.debug = debug @@ -146,6 +147,7 @@ class PyMISP(object): session = requests.Session() session.verify = self.ssl session.proxies = self.proxies + session.cert = self.cert session.headers.update( {'Authorization': self.key, 'Accept': 'application/{}'.format(output),