B4J Question [SOLVED] possible webview cache issue?

aminoacid

Active Member
Licensed User
Longtime User
This is something that has stumped me.

I cannot figure out why the following URL:


works in Chrome and Edge but will not load in webview. This is just a simple apache test page. Nothing complex at all.

I wrote a simple B4J App to test it out. Just one webview control and nothing else. See below - this is the whole program:

B4X:
#Region Project Attributes
    #MainFormWidth: 600
    #MainFormHeight: 600
#End Region

Sub Process_Globals
    Private fx As JFX
    Private MainForm As Form
    Private xui As XUI
    Private WebView1 As WebView
End Sub

Sub AppStart (Form1 As Form, Args() As String)
    MainForm = Form1
    MainForm.RootPane.LoadLayout("Layout1")
    MainForm.Show
    WebView1.LoadUrl("https://strikenet-tx.com/apache.html")
    'WebView1.LoadUrl("https://www.google.com")
End Sub


I tried various web sites like google, etc. It works fine. But I just get a blank screen with the URL "https://strikenet-tx.com/apache.html". And like I said. This URL/page loads fine in all other browsers.

Any suggestions would be appreciated. I have spent a whole day trying to figure this out and I give up!

Thanks!
 
Solution
Ok.... I got it to work. Thank you @sedd and @Sandman
Once I added the certificate to the local JRE cacerts file, I could view the page.
The procedure to do this is outlined in the link below.


[edit] This resolves the problem but it got me thinking about what if you need to distribute the application? You can't expect the end-user to have to add the certificate manually. The certificate is a purchased, perfectly valid certificate (issued by DigiCert) and works in other browsers so it seems strange that this behavior is specific to browsers like curl and webview.
Top