Android Question Okhttp

josejad

Expert
Licensed User
Longtime User
You must use OKHttpUtils2
 
Upvote 0

Chris Guanzon

Active Member
Licensed User
Longtime User
if use OKHttpUtils2 , i'm getting this error in Logs
B4X:
HttpUtils2Service is declared twice. You should either remove the library reference or the code module.
Because i have HttpUtils2Service (Service Module) in my project to Change hc.Initialize in HttpUtils2Service to hc.InitializeAcceptAll
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

Chris Guanzon

Active Member
Licensed User
Longtime User
I removed the httpjob and httputils modules and added okhttputils in my library then added HU2_ACCEPTALL in build configurations (conditional symbols), still getting the same error.
B4X:
javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException:
SSL handshake aborted: ssl=0x7a11ad08: Failure in SSL library, usually a protocol error
error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure (external/openssl/ssl/s23_clnt.c:741 0x74686718:0x00000000)

This happens in some android devices.
 
Upvote 0

Chris Guanzon

Active Member
Licensed User
Longtime User
Yes, the server uses TLS v1.2 . Is there any other way for android 4.4 devices to connect? I also have a device running android 7.0 and i am getting the same error.
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
For Android 4.4, no. This is not a limitation of B4A, nor the library used, but of Android, since it handles the security aspect of the connection. With Android 7 you should have no issues. If you are in control of the server, and support for older Androids is critical, then downgrade the security (by using older TLS version) used by the server. For security reason, I would try to avoid having to use older Android devices.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…