From 27f331a1fc48c80b16ae6242e3581b0f25c35fe3 Mon Sep 17 00:00:00 2001 From: Ruud Date: Sun, 1 Jun 2014 14:30:45 +0200 Subject: [PATCH] Don't verify ssl for downloaders --- couchpotato/core/downloaders/nzbvortex.py | 4 ++-- couchpotato/core/downloaders/sabnzbd.py | 2 +- couchpotato/core/plugins/base.py | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/couchpotato/core/downloaders/nzbvortex.py b/couchpotato/core/downloaders/nzbvortex.py index 9094055f..92ece6d6 100644 --- a/couchpotato/core/downloaders/nzbvortex.py +++ b/couchpotato/core/downloaders/nzbvortex.py @@ -130,7 +130,7 @@ class NZBVortex(DownloaderBase): url = cleanHost(self.conf('host'), ssl = self.conf('ssl')) + 'api/' + call try: - data = self.urlopen('%s?%s' % (url, params), *args, **kwargs) + data = self.urlopen('%s?%s' % (url, params), *args, verify_ssl = False, **kwargs) if data: return json.loads(data) @@ -154,7 +154,7 @@ class NZBVortex(DownloaderBase): url = cleanHost(self.conf('host')) + 'api/app/apilevel' try: - data = self.urlopen(url, show_error = False) + data = self.urlopen(url, show_error = False, verify_ssl = False) self.api_level = float(json.loads(data).get('apilevel')) except URLError as e: if hasattr(e, 'code') and e.code == 403: diff --git a/couchpotato/core/downloaders/sabnzbd.py b/couchpotato/core/downloaders/sabnzbd.py index cd51cb87..57e1dca5 100644 --- a/couchpotato/core/downloaders/sabnzbd.py +++ b/couchpotato/core/downloaders/sabnzbd.py @@ -194,7 +194,7 @@ class Sabnzbd(DownloaderBase): 'output': 'json' })) - data = self.urlopen(url, timeout = 60, show_error = False, headers = {'User-Agent': Env.getIdentifier()}, **kwargs) + data = self.urlopen(url, timeout = 60, show_error = False, verify_ssl = False, headers = {'User-Agent': Env.getIdentifier()}, **kwargs) if use_json: d = json.loads(data) if d.get('error'): diff --git a/couchpotato/core/plugins/base.py b/couchpotato/core/plugins/base.py index f548cb29..dae522f4 100644 --- a/couchpotato/core/plugins/base.py +++ b/couchpotato/core/plugins/base.py @@ -161,7 +161,7 @@ class Plugin(object): log.error('Couldn\'t remove empty directory %s: %s', (folder, traceback.format_exc())) # http request - def urlopen(self, url, timeout = 30, data = None, headers = None, files = None, show_error = True): + def urlopen(self, url, timeout = 30, data = None, headers = None, files = None, show_error = True, verify_ssl = True): url = urllib2.quote(ss(url), safe = "%/:=&?~#+!$,;'@()*[]") if not headers: headers = {} @@ -200,6 +200,7 @@ class Plugin(object): 'data': data if len(data) > 0 else None, 'timeout': timeout, 'files': files, + 'verify': verify_ssl, } method = 'post' if len(data) > 0 or files else 'get'