working around Python SSL bugs

http://bugs.python.org/issue10272 won't be backported