Don't verify ssl for downloaders

This commit is contained in:
Ruud committed 2014-06-01 14:30:45 +02:00
1 parent e6b4d32506
commit 27f331a1fc
3 files changed
+5 -4

No files matched your search

+2 -2
View File
@@ -130,7 +130,7 @@ class NZBVortex(DownloaderBase):
url = cleanHost(self.conf('host'), ssl = self.conf('ssl')) + 'api/' + call url = cleanHost(self.conf('host'), ssl = self.conf('ssl')) + 'api/' + call
try: try:
data = self.urlopen('%s?%s' % (url, params), *args, **kwargs) data = self.urlopen('%s?%s' % (url, params), *args, verify_ssl = False, **kwargs)
if data: if data:
return json.loads(data) return json.loads(data)
@@ -154,7 +154,7 @@ class NZBVortex(DownloaderBase):
url = cleanHost(self.conf('host')) + 'api/app/apilevel' url = cleanHost(self.conf('host')) + 'api/app/apilevel'
try: 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')) self.api_level = float(json.loads(data).get('apilevel'))
except URLError as e: except URLError as e:
if hasattr(e, 'code') and e.code == 403: if hasattr(e, 'code') and e.code == 403:
+1 -1
View File
@@ -194,7 +194,7 @@ class Sabnzbd(DownloaderBase):
'output': 'json' '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: if use_json:
d = json.loads(data) d = json.loads(data)
if d.get('error'): if d.get('error'):
+2 -1
View File
@@ -161,7 +161,7 @@ class Plugin(object):
log.error('Couldn\'t remove empty directory %s: %s', (folder, traceback.format_exc())) log.error('Couldn\'t remove empty directory %s: %s', (folder, traceback.format_exc()))
# http request # 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 = "%/:=&?~#+!$,;'@()*[]") url = urllib2.quote(ss(url), safe = "%/:=&?~#+!$,;'@()*[]")
if not headers: headers = {} if not headers: headers = {}
@@ -200,6 +200,7 @@ class Plugin(object):
'data': data if len(data) > 0 else None, 'data': data if len(data) > 0 else None,
'timeout': timeout, 'timeout': timeout,
'files': files, 'files': files,
'verify': verify_ssl,
} }
method = 'post' if len(data) > 0 or files else 'get' method = 'post' if len(data) > 0 or files else 'get'