Bug? [SOLVED] Received fatal alert: protocol_version

naldoxable

Member
Licensed User
Longtime User
Dear @Erel, I'm experiencing issues using my app with jOkHttpUtils2 outside B4J if I build the standalone package. I have already read other posts in this forum but I'm not sure how to proceed. I'm using the last version of B4J with openJDK 11 as written in the installation guide. I'm using https to connect to my server.

Code: Copy
C:\Users\naldo\OneDrive\Code\B4J Projects\LetsPushHomeTraining\B4J\Objects\temp\build\bin>java.exe @release_java_modules.txt  -m b4j/it.naldoxable.letspushhometraining.main
javax.net.ssl.SSLHandshakeException: Received fatal alert: protocol_version
        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 b4j/okhttp3.internal.connection.RealConnection.connectTls(Unknown Source)
        at b4j/okhttp3.internal.connection.RealConnection.establishProtocol(Unknown Source)
        at b4j/okhttp3.internal.connection.RealConnection.buildConnection(Unknown Source)
        at b4j/okhttp3.internal.connection.RealConnection.connect(Unknown Source)
        at b4j/okhttp3.internal.connection.StreamAllocation.findConnection(Unknown Source)
        at b4j/okhttp3.internal.connection.StreamAllocation.findHealthyConnection(Unknown Source)
        at b4j/okhttp3.internal.connection.StreamAllocation.newStream(Unknown Source)
        at b4j/okhttp3.internal.connection.ConnectInterceptor.intercept(Unknown Source)
        at b4j/okhttp3.internal.http.RealInterceptorChain.proceed(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.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.http.RealInterceptorChain.proceed(Unknown Source)
        at b4j/okhttp3.RealCall.getResponseWithInterceptorChain(Unknown Source)
        at b4j/okhttp3.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)
        Suppressed: javax.net.ssl.SSLHandshakeException: Remote host terminated the handshake
                at java.base/sun.security.ssl.SSLSocketImpl.handleEOF(Unknown Source)
                ... 31 more
        Caused by: java.io.EOFException: SSL peer shut down incorrectly
                at java.base/sun.security.ssl.SSLSocketInputRecord.decode(Unknown Source)
                at java.base/sun.security.ssl.SSLTransport.decode(Unknown Source)
                ... 31 more
ResponseError. Reason: javax.net.ssl.SSLHandshakeException: Received fatal alert: protocol_version, Response:
javax.net.ssl.SSLHandshakeException: Received fatal alert: protocol_version

Thanks is advance!
 
EDIT: After 3 days of testing i found the solution 15 minutes after having published this thread.

The solution is quite easy, just add this line in the Main module
B4X: Copy
#PackagerProperty: IncludedModules = jdk.crypto.ec
 
Ciao anch'io ricevo lo stesso errore, ho letto il post di Erel e ho aggiunto #PackagerProperty: IncludedModules = jdk.crypto.ec ma continuo a ricevere lo stesso errore. Ho anche aggiunto #PackagerProperty: IncludedModules = javafx.web perché stavo ricevendo un errore relativo a jfx. Puoi specificare con un esempio?
 
Hi I solved the jfx web and ssl problem in this way.

B4X: Copy
#PackagerProperty: IncludedModules = jdk.charsets, javafx.web, jdk.crypto.ec
 
Back
Top