1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-13 07:47:14 +03:00

Verify SSL certs only if Python supports SNI

http://docs.python-requests.org/en/master/community/faq/#what-are-hostname-doesn-t-match-errors
This commit is contained in:
Jonathan Harris 2016-03-27 18:37:00 +01:00
parent eecbc625df
commit 2f206d528b

View File

@ -28,7 +28,7 @@ if not getattr(sys, 'frozen', False):
import requests
from xml.etree import ElementTree
r = requests.get(update_feed, timeout = 20)
r = requests.get(update_feed, timeout = 20, verify = (sys.version_info >= (2,7,9)))
feed = ElementTree.fromstring(r.text)
items = dict([(item.find('enclosure').attrib.get('{http://www.andymatuschak.org/xml-namespaces/sparkle}version'),
item.find('title').text) for item in feed.findall('channel/item')])