Fix for 301 redirect and latest PyOpenSSL.

Fixes #1887