L LuigiTasca Member Licensed User Longtime User Oct 13, 2017 #1 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
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
Erel B4X founder Staff member Licensed User Longtime User Oct 15, 2017 #2 Please use [code]code here...[/code] tags when posting code. You need to change HttpUtils2Service code and call InitializeAcceptAll: https://www.b4x.com/android/forum/threads/modify-okhttplibrary-source.79012/#content Upvote 0
Please use [code]code here...[/code] tags when posting code. You need to change HttpUtils2Service code and call InitializeAcceptAll: https://www.b4x.com/android/forum/threads/modify-okhttplibrary-source.79012/#content
L LuigiTasca Member Licensed User Longtime User Oct 16, 2017 #3 Erel said: Please use [code]code here...[/code] tags when posting code. Click to expand... 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? Upvote 0
Erel said: Please use [code]code here...[/code] tags when posting code. Click to expand... 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?
Erel B4X founder Staff member Licensed User Longtime User Oct 16, 2017 #4 LuigiTasca said: How can I do this? Click to expand... Remove the reference to OkHttpUtils2 library. Upvote 0
tufanv Expert Licensed User Longtime User Oct 16, 2017 #5 LuigiTasca said: 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? Click to expand... 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
LuigiTasca said: 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? Click to expand... 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