Works like a charm. Thank you very much.
Blaine -----Original Message----- From: Kalnichevski, Oleg [mailto:[EMAIL PROTECTED] Sent: Thursday, January 29, 2004 2:43 AM To: Commons HttpClient Project Subject: RE: setCredentials Fails in Applet Blaine, Give 'expect: 100-continue' handshake a shot. It is disabled per default http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/http client/methods/ExpectContinueMethod.html#setUseExpectHeader(boolean) If 'expect: 100-continue' does not do the trick, please try to get the wirelog of the HTTP session and post it to the list http://jakarta.apache.org/commons/httpclient/logging.html Oleg -----Original Message----- From: Blaine [mailto:[EMAIL PROTECTED] Sent: Thursday, January 29, 2004 05:23 To: [EMAIL PROTECTED] Subject: setCredentials Fails in Applet Howdy, I have the example MultipartFileUploadApp working as an application. When I try and do the same thing with an applet I can get everything to work except setCredentials. (For testing I have allowed all in the java.policy file) If I put my user:pw in the url it works. That is until I use EasySSLProtocolSocketFactory to accept self signed certs then the url trick fails. But either way even when connecting to a non SSL server the setCredentials does not work from an applet. The exact same piece of code works from an application. I've tried client.getState().setCredentials(null ,null ,new UsernamePasswordCredentials("user", "password") ); And I've also tried populating the first 2 arguments with the correct values. The error I get is java.net.SocketException: Software caused connection abort: socket write error at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(Unknown Source) at java.net.SocketOutputStream.write(Unknown Source) at com.sun.net.ssl.internal.ssl.OutputRecord.a(Unknown Source) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(Unknown Source) at com.sun.net.ssl.internal.ssl.AppOutputStream.write(Unknown Source) at org.apache.commons.httpclient.HttpConnection$WrappedOutputStream.write(HttpC onnection.java:1368) at java.io.BufferedOutputStream.flushBuffer(Unknown Source) at java.io.BufferedOutputStream.write(Unknown Source) at org.apache.commons.httpclient.methods.multipart.FilePart.sendData(FilePart.j ava:259) at org.apache.commons.httpclient.methods.multipart.Part.send(Part.java:293) at org.apache.commons.httpclient.methods.multipart.Part.sendParts(Part.java:342 ) at org.apache.commons.httpclient.methods.MultipartPostMethod.writeRequestBody(M ultipartPostMethod.java:288) at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.jav a:2322) at org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.j ava:2657) at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:109 3) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:674) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:529) at EnvmxScanner.testUploadFile(EnvmxScanner.java:367) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at sun.plugin.com.MethodDispatcher.invoke(Unknown Source) at sun.plugin.com.DispatchImpl.invokeImpl(Unknown Source) at sun.plugin.com.DispatchImpl$2.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at sun.plugin.com.DispatchImpl.invoke(Unknown Source) This is the same error I get in the application if I pass an invalid user/pw. Any help would be greatly appreciated. I need to be able to use an applet against a server that requires basic auth and has a self signed cert. Thanks Blaine --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]