Rewrite authentication and proxy authentication to use a java.net.Authenticator. This will ensure it all happens correctly every time, which it doesn't at present, without any further code being required. Remove said code.
Log in to post a comment.