blueghost56 / ksoap2-android

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

HttpsTransportSE#getServiceConnection() shouldn't return a new instance #189

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It seems like there is a fundamental flaw in the way ksoap2 is made to work 
with SSL.

In the code examples I've seen here and around the web, usually you use 
HttpsTransportSE#getServiceConnection(), and then set the SSLSocketFactory on 
the HttpsServiceConnectionSE object returned. 

Then you invoke HttpsTransportSE#call().

Inside HttpsTransportSE#call() there will be a call to 
HttpsTransportSE#getServiceConnection(), which will return a different instance.

The ServiceConnection object that you set the SSLSocketFactory on is totally 
out of the picture and is in no way connected to the HttpsTransportSE object.

This can easily be remedied by having a HttpsServiceConnectionSE object 
associated with each HttpsTransportSE. And getServiceConnection() would be the 
getter for that field.

I attached my simple fix. I'll push my changes too which would be changes to 
the library as opposed to just a new MyHttpsTransportSE object.

Original issue reported on code.google.com by yousifu...@gmail.com on 23 Apr 2014 at 7:53

Attachments:

GoogleCodeExporter commented 9 years ago
Actually, I will not make any pushes on Github since it is a very small change 
and I'm not sure if's the best way to solve the issue given the design of the 
library. The file I attached should be pretty easy for anyone to implement.

Original comment by yousifu...@gmail.com on 23 Apr 2014 at 8:05

GoogleCodeExporter commented 9 years ago

Original comment by mosa...@gmail.com on 9 May 2014 at 6:31