ketan-sharma-developer / ksoap2-android

Automatically exported from code.google.com/p/ksoap2-android
0 stars 0 forks source link

javax.net.ssl.SSLException: Write error: ssl=0x5c62dca0: I/O error during system call, Connection reset by peer #173

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.using https, setting all certificates trusted
2.using keep-alive, exception:
property=new HeaderProperty("Connection", "keep-alive");
headerList.add(0, property);
httpTransportSE.call(ACTION_SOAP_GetBranchListData, envelope, headerList);
property.setValue("close");
headerList.set(0, property);
3.The first visit is normal, about two or three minutes,visit again will 
exception "javax.net.ssl.SSLException: Write error: ssl=0x5c62dca0: I/O error 
during system call, Connection reset by peer" occur

What is the expected output? What do you see instead?
javax.net.ssl.SSLException: Write error: ssl=0x5c62dca0: I/O error during 
system call, Connection reset by peer

What version of the product are you using? On what operating system?
ksoap2-android-assembly-3.0.0-jar-with-dependencies.jar

Please provide any additional information below.

Original issue reported on code.google.com by shixianm...@gmail.com on 17 Oct 2013 at 2:45

GoogleCodeExporter commented 8 years ago
This is still a problem in 3.1.1. It's caused by not calling 
connection.disconnect() in the httpTransportSE.call code.

The hack that worked for me was adding in a header property of "Connection : 
close". 
ArrayList<HeaderProperty> headerPropertyArrayList = new 
ArrayList<HeaderProperty>();
headerPropertyArrayList.add(new HeaderProperty("Connection", "close"));
And updating your call with ".call(SOAP_ACTION, envelope, 
headerPropertyArrayList)"

Original comment by islandma...@gmail.com on 29 Jan 2014 at 8:51

GoogleCodeExporter commented 8 years ago
Could you provide a pull request that fixes it in master

Original comment by mosa...@gmail.com on 29 Jan 2014 at 9:19

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
A pull has been requested. 

This is actually an android bug and I have submitted a ticket at 
https://code.google.com/p/android/issues/detail?id=65463 where I go into more 
detail about why this doesn't work. 

The above solution should work until the new version of ksoap is released that 
has my fix. After downloading the new version, the solution is simple: When you 
get this error, retry the webservice call. Android will return a working 
connection and everything will be normal. 

Technically webservice calls shouldn't be trusted anyway so checking for an 
exception and retrying isn't a bad coding practice. 

Original comment by islandma...@gmail.com on 31 Jan 2014 at 6:39

GoogleCodeExporter commented 8 years ago
Please test this off master and confirm

Original comment by mosa...@gmail.com on 8 Feb 2014 at 12:26

GoogleCodeExporter commented 8 years ago
Have same problem with 3.2
islandma...@gmail.com's hack works for me. Thanks!

Original comment by farique...@gmail.com on 29 Mar 2014 at 7:47

GoogleCodeExporter commented 8 years ago
Omg thx a lot Islandma(...) !!

Original comment by grosnour...@gmail.com on 19 Aug 2014 at 5:03

GoogleCodeExporter commented 8 years ago
Thx Islandma,That help me a lot.

Original comment by ak1...@gmail.com on 16 Oct 2014 at 4:52