B4J Question [SOLVED] B4JPackager11 error javax.net.ssl.SSLHandshakeException

Hendrik Wijaya

Member
Licensed User
Hi,

I build myapplication using java11 (downloaded from this site) and it run well when using java.
When i package myapplication using B4JPackager11, it show error:



I also try to change hc.Initialize to hc.InitializeAcceptAll in HttpUtils2Service. But, it still show this error.


Thanks
 
Solution
New instructions:

Add to main module:
B4X:
#PackagerProperty: IncludedModules = jdk.crypto.ec

Add this module:
B4X:
Private IncludedModules As List = Array("jdk.crypto.ec")
Explanation: https://stackoverflow.com/questions/54770538/received-fatal-alert-handshake-failure-in-jlinked-jre
You can also add it in the json file.

Tip: simplify your program to:
B4X:
Dim v As HttpJob
v.Initialize("",Me)
v.Download(url)
Wait For (v) JobDone(v As HttpJob)
If v.Success Then
   LBL_Info.Text = v.GetString
End If
v.Release
And you should also use jOkHttpUtils2 library instead of the modules.

Hendrik Wijaya

Member
Licensed User
Yes Erel, Cloudflare support TLS 1 to 1.3.
Myapp can run well from "java -jar myapps.jar"
It only shows error when using B4JPackager11.
Here I attach the file for test.


Thanks
 

Attachments

  • javatest.zip
    52.6 KB · Views: 354
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
New instructions:

Add to main module:
B4X:
#PackagerProperty: IncludedModules = jdk.crypto.ec

Add this module:
B4X:
Private IncludedModules As List = Array("jdk.crypto.ec")
Explanation: https://stackoverflow.com/questions/54770538/received-fatal-alert-handshake-failure-in-jlinked-jre
You can also add it in the json file.

Tip: simplify your program to:
B4X:
Dim v As HttpJob
v.Initialize("",Me)
v.Download(url)
Wait For (v) JobDone(v As HttpJob)
If v.Success Then
   LBL_Info.Text = v.GetString
End If
v.Release
And you should also use jOkHttpUtils2 library instead of the modules.
 
Last edited:
Upvote 0
Solution
Cookies are required to use this site. You must accept them to continue using the site. Learn more…