Android Question OkHttpUtils2 and accept all option

awama

Active Member
Licensed User
Longtime User
Hello,

I get this error on my Smartphone (P8_2017, Android 7.0) , when I try to download a website:

Error: javax.net.ssl.SSLHandsheakeException handshake failed

On other Smartphones newer and older there are no problems

Solution from Erel from an older thread:
Starting from v2.90 it is very simple to initialize the internal http client with the 'accept all' option.
The accept all option means that certificates will not be validated.
It is done by adding the following conditional symbol (Ctrl + B):
HU2_ACCEPTALL

I use OkHttpUtils2 v2,90 and I added Conditional Symbol: HU2_ACCEPTALL and nothing else I do.
But the problem was not solved.
What can I do else?

awama
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
1. Check the logs and look for a message that HttpClient was initialized with accept all.

2. 'Accept all' option solves a very specific case where the certificate is not recognized. It will not help in cases where the SSL protocol is not supported by the device.

A possible solution for devices that don't support TLS 1.2 and newer protocols: https://www.b4x.com/android/forum/threads/ssl-websocket-client.88472/page-2#post-560044
 
Upvote 0
Top