Android Question OkHTTP problem

VTSinLincoln

Member
Licensed User
Longtime User
I've created a B4A app using HttpUtils2 to access a web service using HTTPS. Up until now, the web service has been running on IIS 7.5 and IIS 8.5 without issue. I can access it with the mobile app running on Android 4.4 and Android 6 devices.

I'm now trying to get the web app ported to IIS 10 (Windows 10). All is well with Postman (API tester) and Android 4.4 devices. With Android 6 devices I get this exception:
java.io.IOException: PROTOCOL_ERROR

Wireshark on the IIS 10 machine shows the Android 4.4 device is using TLS 1.0 while Android 6 is using TLS1.2 (as is Postman and any browsers I use to test). Interestingly, if I use a browser on an Android 6 device (which uses TLS1.2), I get what I expect from the query. It's only the app and OkHTTP that has the problem.

Do you have any suggestions?

OkHTTP is version 1.2 (using V7.3 of B4A).

Vaughan
 

VTSinLincoln

Member
Licensed User
Longtime User
You can try Http / HttpUtils2 instead and see whether it makes any difference. My guess is that the server is not configured properly.
Hi Erel

I'm already using HttpUtils2 in source form as I'm using InitializeAcceptAll (I'm using a self-signed certificate on my web service). The exception is reported via the Reason parameter of hc_ResponseError.

Ironically, the problem has gone away without any changes on my part (truly! :)). I'm still a bit nervous as I've seen other reports of random exceptions, e.g.: https://github.com/square/okhttp/issues/1844

What version of OkHttp is the B4A library using? Can I replace the B4A library with one built from a later version? If so, how? (I had a quick look for a tutorial, but didn't see one).


Vaughan
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Ironically, the problem has gone away without any changes on my part (truly! :)). I'm still a bit nervous as I've seen other reports of random exceptions, e.g.: https://github.com/square/okhttp/issues/1844
This issue is from 2015. It wasn't fixed (assuming that it is a problem in OkHttp) in any version of OkHttp.

B4A OkHttp library is based on OkHttp v3.5. It is impossible to say whether upgrading the native library will work or not.
 
Upvote 0

VTSinLincoln

Member
Licensed User
Longtime User
This issue is from 2015. It wasn't fixed (assuming that it is a problem in OkHttp) in any version of OkHttp.

B4A OkHttp library is based on OkHttp v3.5. It is impossible to say whether upgrading the native library will work or not.
Hi Erel

I'm going to try a clean install of everything. If the problem reappears, I'll go down the path of upgrading the library. If not, I'll put it down to finger trouble on my part (not that IIS has much in the way of low level setup - that's mostly done in the registry by adding keys and I didn't do that until after I found the issue. All my registry changes have since been removed and it still all goes).

Thanks for the replies.

Vaughan
 
Upvote 0
Top