commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Becke <be...@u.washington.edu>
Subject Re: setCredentials Fails in Applet
Date Thu, 29 Jan 2004 04:08:16 GMT
Hi Blaine,

Please pose this question to the commons-httpclient mailing list  
<http://jakarta.apache.org/commons/httpclient/mail-lists.html>.  Though  
some of the HttpClient developers (like me) read this list, you will  
get more of a response there.

Thanks,

Mike

On Jan 28, 2004, at 6:14 PM, Blaine wrote:

> 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(FileP 
> art.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.jav 
> a:342
> )
>
>             at
> org.apache.commons.httpclient.methods.MultipartPostMethod.writeRequestB 
> ody(M
> ultipartPostMethod.java:288)
>
>             at
> org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBas 
> e.jav
> a:2322)
>
>             at
> org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodB 
> ase.j
> ava:2657)
>
>             at
> org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.jav 
> a: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: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message