BUG!!! -- JDK1.3.1_01+ causes URLConnection.setRequestProperty error
This is a very specific bug. It is only revealed when using the BASE64Encoder in conjunction with the setRequestProperty method of the URLConnection class.
In JDK1.3.1_01+, code that worked fine in JDK1.2.2 and JDK1.3.0 throws the error:
"java.lang.IllegalArgumentException: Illegal character(s) in message header value: Basic <encrypted string>"
The code used was:
--
String User = "Username:Password";
BASE64Encoder encoder = new BASE64Encoder();
String encoding = new String(encoder.encodeBuffer(User.getBytes()));
URLConnection uc = url.openConnection();
uc.setRequestProperty("Authorization", "Basic " + encoding);
--
Without the ability to send 64bit encrypted data to a web server as a header, any URL that requires basic authentication is unretrievable.

