C copiloto Member Licensed User Longtime User Nov 30, 2016 #1 Hello, I'm modifying the code of my apps which use http protocol to OkHttp. Because of I'm having some troubles, have decided to use Erel's example code in order to be sure about right code. I can't undestand where is my error when using my code instead of Erel's code: Code: Copy job3.Initialize("Job3", Me) job3.Download("https://www.b4x.com/images/b4A_bubble.png") My code: Code: Copy job3.Initialize("Job3", Me) job3.Download("https://www.aemps.gob.es/cima/pdfs/es/ft/57819/FT_57819.pdf") Then, capturing data is also done with Erel's method at JobDone module: Code: Copy Dim out As OutputStream = File.OpenOutput(File.DirRootExternal, "medicine.pdf", False) File.Copy2(job.GetInputStream, out) out.Close '<------ very important Running the code, a handshake error is showed: javax.net.ssl.SSLHandshakeException: Handshake failed It's sure that the error is not related to not using user nor password. It's not necessary at all, and never used it when running the previous http protocols. Could someone help me a bit please? Thanks in advance.
Hello, I'm modifying the code of my apps which use http protocol to OkHttp. Because of I'm having some troubles, have decided to use Erel's example code in order to be sure about right code. I can't undestand where is my error when using my code instead of Erel's code: Code: Copy job3.Initialize("Job3", Me) job3.Download("https://www.b4x.com/images/b4A_bubble.png") My code: Code: Copy job3.Initialize("Job3", Me) job3.Download("https://www.aemps.gob.es/cima/pdfs/es/ft/57819/FT_57819.pdf") Then, capturing data is also done with Erel's method at JobDone module: Code: Copy Dim out As OutputStream = File.OpenOutput(File.DirRootExternal, "medicine.pdf", False) File.Copy2(job.GetInputStream, out) out.Close '<------ very important Running the code, a handshake error is showed: javax.net.ssl.SSLHandshakeException: Handshake failed It's sure that the error is not related to not using user nor password. It's not necessary at all, and never used it when running the previous http protocols. Could someone help me a bit please? Thanks in advance.
DonManfred Expert Licensed User Longtime User Dec 1, 2016 #2 The Certificate your domain is using is not valid. Use http:// or use the code version of okhttputils and initialize the client to accept all certificates (initializeacceptall or so) Upvote 0
The Certificate your domain is using is not valid. Use http:// or use the code version of okhttputils and initialize the client to accept all certificates (initializeacceptall or so)
C copiloto Member Licensed User Longtime User Dec 1, 2016 #3 DonManfred, I appreciate your help. However, it doesn't works for mine. Perhaps server doesn't like new http protocols?.. The answer is still the same: "javax.net.ssl.SSLHandshakeException: Handshake failed" even modifying hc in HttpUtils2Service code like you suggest to me: Code: Copy TempFolder = File.DirInternalCache ' hc.Initialize("hc") hc.InitializeAcceptAll("hc") TaskIdToJob.Initialize So, I'll have to return to previous code. Best regards. Upvote 0
DonManfred, I appreciate your help. However, it doesn't works for mine. Perhaps server doesn't like new http protocols?.. The answer is still the same: "javax.net.ssl.SSLHandshakeException: Handshake failed" even modifying hc in HttpUtils2Service code like you suggest to me: Code: Copy TempFolder = File.DirInternalCache ' hc.Initialize("hc") hc.InitializeAcceptAll("hc") TaskIdToJob.Initialize So, I'll have to return to previous code. Best regards.