B4J Question LoadURL HTTPS - via WebView - com.sun.webkit.network.URLLoader doRun

petr4ppc

Well-Known Member
Licensed User
Longtime User
Dear friends,

I have read this thread where is desribed the solution:

this is the solution
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

but I not understand how can I use this solution for open "https" site with webview...
I hope that it is not dumb question,
please very much for help,
thank you
p4ppc
 

petr4ppc

Well-Known Member
Licensed User
Longtime User
Thank you for your answer, Erel,

I am using B4J 7.51

I am using example from the thread and I get:

In B4J I see in WebView only white screen - after compile with B4JPackager (Jana 11) , I see the same.
I have tried some steps I found on the forum, for example:
B4X:
SetSystemProperty("jsse.enableSNIExtension", "false")
but it is not usable in my case.

If somebody know, where I am doing mistake, please for advice,
thank you very much
p4ppc
 
Upvote 0

Daestrum

Expert
Licensed User
Longtime User
If you could post the URL you are trying to connect to (providing it's a public one), it would enable us to try it and seek a solution for you.
 
Upvote 0

petr4ppc

Well-Known Member
Licensed User
Longtime User
Dear Daestrum.

The LOG result I wrote is output from my B4J. As I wrote in first post, I am using described link:
please Click here
In Mozilla it is not OK
In Chrome it is OK
In WebView it is not OK

Thank you
p4pc
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
The problem happens because it uses an old and deprecated SSL protocol.

This code works:
B4X:
Sub Process_Globals
    Private fx As JFX
    Private MainForm As Form
    Private WebView1 As WebView
End Sub

Sub AppStart (Form1 As Form, Args() As String)
    SetSystemProperty("deployment.security.TLSv1", "true")
    SetSystemProperty("https.protocols", "TLSv1")
    MainForm = Form1
    MainForm.RootPane.LoadLayout("1") 'Load the layout file.
    MainForm.Show
    WebView1.LoadUrl("https://apps.ika.gr/eAccess/")
End Sub

Based on: https://stackoverflow.com/questions...slexception-received-fatal-alert-close-notify
 
Upvote 0

petr4ppc

Well-Known Member
Licensed User
Longtime User
Dear Erel,

thank you very much for your help - yes it is perfect.

Best regards
p4ppc
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…