Make it throw an exception when login fails. Add additional parameters related to SSL handling