Android Question HttpJob SSL problem

LuigiTasca

Member
Licensed User
Longtime User
Hi everyone,
at first I'm sorry for my english.
So, I get this problem when I was changing some requestes from httpclient to httpjob.
This is my code:

Sub MySub
Dim Payload As String = "[...]"

Dim j As HttpJob
j.Initialize("",Me)
j.GetRequest.Timeout = 5000
j.PostString("https://...",Payload)

Wait For (j) JobDone(j As HttpJob)

If j.Success Then
Dim JSON As String
Dim JSONP As JSONParser

JSON = j.GetString
Dim myMap As Map

JSONP.Initialize(JSON)
myMap = JSONP.NextObject

[...]
End If

When I make my request I get this response error:

javax.net.ssl.SSLHandshakeException:
Java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.

Once I used HttpClint.InitializeAcceptAll to agree the comunication.
How I can do it with a HttpJob object please?

I serched in the forum but I can't find anything
 

tufanv

Expert
Licensed User
Longtime User
Ok, thank you. How can I change the HttpUtils2Service source?

Here https://www.b4x.com/android/forum/threads/okhttp-replaces-the-http-library.54723/ I have the module. But I cannot import it like a other service, right?
If I do this I get "HttpUtils2Service is declared twice". How can I do this?
First you can uncheck the httputils2 from libraries tab , later add the service module , the module will be added to module tabs. switch to that , and search for "hc.initialize" and change it to hc.initializeacceptall
 
Upvote 0
Top