[1.5.x] Replaced deprecated sslerror by ssl.SSLError

The exact conditions on which this exception is raised are not
known, but this replacement is the best guess we can do at this
point.
Backport of 850630b4b7 from master.