Expect the right exception
Handle non-bytes objects correctly
Raise a python exception, not an ssl one