When User and/or Password are too long, then the Authorization Header is broken

I created the test that shows the problem.

This is probably caused by the sun Base64Encoder: sun.misc.BASE64Encoder

I cat provide a PR with the solution, but wasn't sure about the best approach. What do you think? Implement a new Base64Encoder class, add something like commons-codec to the project, replace the \n in the string generated by the Base64Encoder or there is any other implementation of Base64 already in the project?

Thouhgts?