Test bad request handling when using TLS protocol