Android Question OKHttp TLS1.2 Android4.0

AHilberink

Well-Known Member
Licensed User
Longtime User
Hi,

I have an Android4.0.2 Samsung TAB4 and want to communicate with a server over HTTPS TLS1.2

Is there a way to force OKHttp for using TLS1.2? Will it work on Android4.0?

I am able to use .InitializeAcceptAll, but I prefer maximum security.

Best regards,
André
 

AHilberink

Well-Known Member
Licensed User
Longtime User
InitializeAcceptAll will not help if your device doesn't support the server chosen algorithm.

You can update the supported security provider as explained here: https://www.b4x.com/android/forum/threads/ssl-websocket-client.88472/page-2#post-560044

It will be simpler to use an Android 5+ device.

Thanks. After using .InitializeAcceptAll, the httpjob works fine. According to your explanation the device does support the chosen algorithm.

Should I look for an incorrect installation of the certificate? My device with android 8 and 9 are working fine with standaard library of OKHttp.

I will try using the update of the security provider.

Best regards,
André
 
Upvote 0

AHilberink

Well-Known Member
Licensed User
Longtime User
You haven't provided enough information for us to help you. Where is the error message?

Of course, sorry. The message is:
ResponseError. Reason: javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.

Best regards,
André
 
Upvote 0
Top