B4J Question handshake_failure

kohle

Active Member
Licensed User
Longtime User
Hi,

when I run this function in the debugger mode it works fine.
If I build a standalone packets, I get a error : handshake error.
I added a screenshot of my library list and path to OpenJDK 19.0.2



B4X:
Sub getToken() As ResumableSub
   
    Dim j As HttpJob
    j.Initialize("", Me)

lblLast.Text=""  

logJK(url_login)
   
j.PostString(url_login,"password=xxxxxxxxxxx")
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
       
        Dim parser As JSONParser
        parser.Initialize(j.GetString)
        Dim root As Map = parser.NextObject
        Dim token As String = root.Get("token")
       
        If token<>"" Then
            logJK("Token erhalten")
            lblLast.Text=token  
        Else
            logJK(j.GetString)
        End If  
End If  
j.Release

Return 1


Error:
B4X:
E:\b4j_projekte\chargebee_import\Objects\temp\build\bin>java.exe @release_java_modules.txt  -m b4j/b4j.example.main
https://orders.xxxxxxx.de/public/index.php/api/login
javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
        at java.base/sun.security.ssl.Alert.createSSLException(Unknown Source)
        at java.base/sun.security.ssl.Alert.createSSLException(Unknown Source)
        at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source)
        at java.base/sun.security.ssl.Alert$AlertConsumer.consume(Unknown Source)
        at java.base/sun.security.ssl.TransportContext.dispatch(Unknown Source)
        at java.base/sun.security.ssl.SSLTransport.decode(Unknown Source)
        at java.base/sun.security.ssl.SSLSocketImpl.decode(Unknown Source)
        at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(Unknown Source)
        at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
        at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
        at b4j/okhttp3.internal.connection.RealConnection.connectTls(Unknown Source)
        at b4j/okhttp3.internal.connection.RealConnection.establishProtocol(Unknown Source)
        at b4j/okhttp3.internal.connection.RealConnection.connect(Unknown Source)
        at b4j/okhttp3.internal.connection.ExchangeFinder.findConnection(Unknown Source)
        at b4j/okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(Unknown Source)
        at b4j/okhttp3.internal.connection.ExchangeFinder.find(Unknown Source)
        at b4j/okhttp3.internal.connection.RealCall.initExchange$okhttp(Unknown Source)
        at b4j/okhttp3.internal.connection.ConnectInterceptor.intercept(Unknown Source)
        at b4j/okhttp3.internal.http.RealInterceptorChain.proceed(Unknown Source)
        at b4j/okhttp3.internal.cache.CacheInterceptor.intercept(Unknown Source)
        at b4j/okhttp3.internal.http.RealInterceptorChain.proceed(Unknown Source)
        at b4j/okhttp3.internal.http.BridgeInterceptor.intercept(Unknown Source)
        at b4j/okhttp3.internal.http.RealInterceptorChain.proceed(Unknown Source)
        at b4j/okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(Unknown Source)
        at b4j/okhttp3.internal.http.RealInterceptorChain.proceed(Unknown Source)
        at b4j/okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(Unknown Source)
        at b4j/okhttp3.internal.connection.RealCall.execute(Unknown Source)
        at b4j/anywheresoftware.b4h.okhttp.OkHttpClientWrapper.executeWithTimeout(Unknown Source)
        at b4j/anywheresoftware.b4h.okhttp.OkHttpClientWrapper.access$0(Unknown Source)
        at b4j/anywheresoftware.b4h.okhttp.OkHttpClientWrapper$ExecuteHelper.run(Unknown Source)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)
 

Attachments

  • 2026-05-18_15-59-10.png
    18.9 KB · Views: 16
  • 2026-05-18_15-58-34.png
    18.5 KB · Views: 19
Solution
7. If you get an error that looks like: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure, add:

B4X:
#PackagerProperty: IncludedModules = jdk.crypto.ec

aeric

Expert
Licensed User
Longtime User
7. If you get an error that looks like: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure, add:

B4X:
#PackagerProperty: IncludedModules = jdk.crypto.ec

 
Upvote 1
Solution
Cookies are required to use this site. You must accept them to continue using the site. Learn more…