B4J Question javax.net.ssl.SSLException: Received fatal alert: close_notify

mc73

Well-Known Member
Licensed User
Longtime User
Loading this page inside a webView (or by using okHttp) https://apps.ika.gr/eAccess/
I get this error:
B4X:
javax.net.ssl.SSLException: Received fatal alert: close_notify
The full log:
B4X:
Dec 23, 2018 10:52:43 AM com.sun.webkit.network.URLLoader doRun
WARNING: Unexpected error
javax.net.ssl.SSLException: Received fatal alert: close_notify
   at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)
   at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)
   at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:2038)
   at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1135)
   at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1385)
   at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413)
   at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1397)
   at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)
   at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
   at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:162)
   at com.sun.webkit.network.URLLoader.sendRequest(URLLoader.java:371)
   at com.sun.webkit.network.URLLoader.doRun(URLLoader.java:167)
   at com.sun.webkit.network.URLLoader.lambda$run$98(URLLoader.java:132)
   at java.security.AccessController.doPrivileged(Native Method)
   at com.sun.webkit.network.URLLoader.run(URLLoader.java:131)
   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
   at java.util.concurrent.FutureTask.run(FutureTask.java:266)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
   at java.lang.Thread.run(Thread.java:748)
Any help on this?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

mc73

Well-Known Member
Licensed User
Longtime User
This code does work:
B4X:
Dim j As HttpJob
j.Initialize("", Me)
j.Download("https://apps.ika.gr/eAccess/")
Wait For JobDone(j As HttpJob)
If j.Success Then
   Log(j.GetString)
End If
j.Release

It seems like this site only supports old protocols: https://www.ssllabs.com/ssltest/analyze.html?d=apps.ika.gr

It is possible to disable certificate checks with WebView: https://www.b4x.com/android/forum/threads/webview-certificate-lets-encrypt.64832/#post-410628
However it doesn't help in this case.

True, httpUtils works as expected, at least after I update to the new b4J beta version and to java 11. Earlier, I got the same error message also from httpUtils.
So, I'm fine, httpUtils will do my job, thank you very much Erel!
 
Upvote 0
Top