I'm having this SSL issue with feedparser
parsing an HTTPS RSS feed, I don't really know what to do as I can't find any documentation on this error when it comes to feedparser:
>>> import feedparser
>>> feed = feedparser.parse(rss)
>>> feed
{'feed': {}, 'bozo': 1, 'bozo_exception': URLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)'),), 'entries': []}
>>> feed["items"]
[]
>>>
This is due to Python beginning to apply certificate verification by default for stdlib http clients.
A great explanation of the rationale of the change can be found in this Redhat article. There's also information regarding how to control and troubleshoot this new situation.
Both previous references explain how to avoid certificate verification in single connections (which is not a solution for feedparser users):
Currently, feedparser users can only avoid certificate verification by monkeypatching, which is highly discouraged as it affects the whole application.
The code to change the behavior application-wide would be as follows (code taken from PEP-476):
There is an issue on the feedparser tracker about this:
How to fix SSL: CERTIFICATE_VERIFY_FAILED?
.Thanks you cmidi for the answer, which was to 'monkey patch' using
ssl._create_default_https_context = ssl._create_unverified_context