test pyopenssl redirect (unit test for #1887)
on redirect pass URL as bytes. Fixes: #1887
Merge pull request #1888 from longaccess/handle301

Fix for 301 redirect and latest PyOpenSSL.