I've been using a Python script (2.7.6 on Ubuntu 14.04LTS) to pick entries from RSS feeds using the "feedparser" module. This week it stopped working with a particular site. Digging, feedparser.parse() was returning a structure with an error code:
'bozo_exception': URLError(SSLError(1, '_ssl.c:510: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure'),)
Do I need to force a particular SSL or TLS version?
Tried going to lower levels with various urllib modules (urllib, urllib2, urllib3). Eventually this:
import urllib3
req = urllib3.PoolManager().request('GET', my_https_url)
which replied with a couple of warnings like:
/usr/lib/python2.7/dist-packages/urllib3/util/ssl_.py:133: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecurePlatformWarning
Apparently this is fixed in Python 2.7.9, but that wasn't pre-packaged for this old Ubuntu 14.04. Yet I want that OS because of some other elderly software that needs to keep running.
Simple workaround: it was enough to update my RSS-picker to just use python3 (3.4.3 is current on 14.04). No need to pass anything special, e.g., transport level options like somehow creating an SSLContext, to the feedparser module – the defaults worked fine. The only python2->3 changes needed were to print() and a couple of string-to-bytes s.encode('utf-8') things.