Workaround for TLS 1.1/1.2 issues introduced in OpenSSL 1.0

For Python 3.2+ we can solve it easily by giving an SSLContext
that explicitly sets protocol version. For older Python version,
wen need an ugly workaround that replaces a function in http lib.