B4J Question b4j does not open an https ssl site, what to do?

Xfood

Expert
Licensed User
Good morning,
and for 2 days I've been trying to open this site from b4j with webview, I've tried all the possible settings found on the forum, but the page doesn't open, could someone check why?
Thanks
WebView1.LoadURL("https://cloud.profimax.it")
 

DonManfred

Expert
Licensed User
Longtime User
it is not related to b4j.

The site does not open in a webbrowser too.
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
I can confirm it opens in Edge
*
1747154885090.png
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
This may be of help:

 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
I can open my web site that is encrypted using Let's Encrypt with a B4j Webview, Let's encrypt is not the specific cause. That's not to say that it's configuration or integration with something else on the page is not causing it.
 
Upvote 0

Daestrum

Expert
Licensed User
Longtime User
Possibly
B4X:
YourWebView.As(JavaObject).RunMethodJO("getEngine",null).RunMethod("setUserAgent",Array("my webview"))

(not tested)
 
Upvote 0

Xfood

Expert
Licensed User
Possibly
B4X:
YourWebView.As(JavaObject).RunMethodJO("getEngine",null).RunMethod("setUserAgent",Array("my webview"))

(not tested)
unfortunately it doesn't work,
I tried your suggestion like this

B4X:
WebView1.As(JavaObject).RunMethodJO("getEngine",Null).RunMethod("setUserAgent",Array("WebView1"))
WebView1.LoadURL("https://cloud.profimax.it/")

I tried it like this too, but it doesn't work
B4X:
    WebView1.As(JavaObject).RunMethodJO("getEngine",Null).RunMethod("setUserAgent",Array("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.246"))
    WebView1.LoadURL("https://cloud.profimax.it/")
the page remains blank
1747201695666.png
 
Last edited:
Upvote 0

tchart

Well-Known Member
Licensed User
Longtime User
Possibly
B4X:
YourWebView.As(JavaObject).RunMethodJO("getEngine",null).RunMethod("setUserAgent",Array("my webview"))

(not tested)
What JRE/JDK are you running?

A few years back my application stopped working with a site as the site switched to their certificates to the Google CA which wasn’t in JRE store. Updating the JRE resolved the issue.

Java has a list of trusted CA (certificate authorities) which can become out of date.
 
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
test.

B4X:
    #PackagerProperty: VMArgs = --add-opens java.base/sun.security.ssl=b4j
    #PackagerProperty: IncludedModules = jdk.crypto.ec
B4X:
Sub AppStart (Form1 As Form, Args() As String)
    MainForm = Form1
    SetSystemProperty("jdk.tls.client.protocols","TLSv1,TLSv1.1,TLSv1.2")
    SetSystemProperty("deployment.security.TLSv1.2","true")
    SetSystemProperty("https.protocols","TLSv1.2")
'    MainForm.Show
    Dim PagesManager As B4XPagesManager
    PagesManager.Initialize(MainForm)
End Sub

1747219770062.png
 
Upvote 0

Xfood

Expert
Licensed User
test.

B4X:
    #PackagerProperty: VMArgs = --add-opens java.base/sun.security.ssl=b4j
    #PackagerProperty: IncludedModules = jdk.crypto.ec
B4X:
Sub AppStart (Form1 As Form, Args() As String)
    MainForm = Form1
    SetSystemProperty("jdk.tls.client.protocols","TLSv1,TLSv1.1,TLSv1.2")
    SetSystemProperty("deployment.security.TLSv1.2","true")
    SetSystemProperty("https.protocols","TLSv1.2")
'    MainForm.Show
    Dim PagesManager As B4XPagesManager
    PagesManager.Initialize(MainForm)
End Sub

View attachment 164049
Thank you, I'm out now, tonight I'll try and let you know
 
Upvote 0

Sagenut

Expert
Licensed User
Longtime User
It looks like it's unable to make a first sort of redirect.
Using the already complete URL
B4X:
https://cloud.profimax.it/auth/realms/Profimax/protocol/openid-connect/auth?client_id=website&redirect_uri=https%3A%2F%2Fcloud.profimax.it%2Fit&state=9643d1a9-ec3e-46bc-a6d6-fe696b77d6bc&response_mode=fragment&response_type=code&scope=openid&nonce=afec59d6-cf23-458a-af9f-d462b9c34628&code_challenge=wTOlLqgyerZ5mH1J1TWwhjc9hfmZT3gQpI0ly3BqggA&code_challenge_method=S256
it works
profi.jpg

But I understand that it's not the desired result and that maybe the url can change from session to session.
 
Upvote 0

Xfood

Expert
Licensed User
It looks like it's unable to make a first sort of redirect.
Using the already complete URL
B4X:
https://cloud.profimax.it/auth/realms/Profimax/protocol/openid-connect/auth?client_id=website&redirect_uri=https%3A%2F%2Fcloud.profimax.it%2Fit&state=9643d1a9-ec3e-46bc-a6d6-fe696b77d6bc&response_mode=fragment&response_type=code&scope=openid&nonce=afec59d6-cf23-458a-af9f-d462b9c34628&code_challenge=wTOlLqgyerZ5mH1J1TWwhjc9hfmZT3gQpI0ly3BqggA&code_challenge_method=S256
it works
View attachment 164053
But I understand that it's not the desired result and that maybe the url can change from session to session.
That's right, why does this happen?
 
Upvote 0

Xfood

Expert
Licensed User
test.

B4X:
    #PackagerProperty: VMArgs = --add-opens java.base/sun.security.ssl=b4j
    #PackagerProperty: IncludedModules = jdk.crypto.ec
B4X:
Sub AppStart (Form1 As Form, Args() As String)
    MainForm = Form1
    SetSystemProperty("jdk.tls.client.protocols","TLSv1,TLSv1.1,TLSv1.2")
    SetSystemProperty("deployment.security.TLSv1.2","true")
    SetSystemProperty("https.protocols","TLSv1.2")
'    MainForm.Show
    Dim PagesManager As B4XPagesManager
    PagesManager.Initialize(MainForm)
End Sub

View attachment 164049
just tried it, unfortunately it doesn't work,
there's a blank page
1747243413262.png



1747243516716.png
 
Upvote 0
Top