Android Question WebView SslError = 3

peacemaker

Expert
Licensed User
Longtime User
Hi, All

B4X:
Sub wvc_ReceivedSslError(SslErrorHandler1 As SslErrorHandler, SslError1 As SslError)
    Log(SslError1)    'SSL_UNTRUSTED
    SslErrorHandler1.Proceed
End Sub

Proceed does not work :(, webview is blank.
Any help ?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
This code works fine with an invalid SSL certificate:
B4X:
Sub Globals

   Private WebView1 As WebView
   Private we As WebViewExtras
End Sub

Sub Activity_Create(FirstTime As Boolean)
   Activity.LoadLayout("1")
   we.Initialize(WebView1)
   Dim client As DefaultWebViewClient
   client.Initialize("client")
   we.SetWebViewClient(client)
   WebView1.LoadUrl("https://67.227.218.133/")
End Sub

Sub client_ReceivedSslError(SslErrorHandler1 As SslErrorHandler, SslError1 As SslError)
   Log(SslError1)
   SslErrorHandler1.Proceed
End Sub
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
Very strange.
My URL is "https://www.saqqent.com", it gives SSLERROR=3, your website https://67.227.218.133/ gives SSLERROR=2.
The test project is attached - works OK with both URLs, but my WebView project works OK only with your URL. But my URL - no, just blank WebView :(

Erel, maybe could you check my project, if i email it to you privately ?
 

Attachments

  • test_sslerror.zip
    8.6 KB · Views: 242
Last edited:
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
The trouble reason - AHSwipeToRefresh view: most URLs works OK (according my tests with webview client apps), and if no SSLERROR - also works OK.
But ... else URLs do not work with WebView placed into AHSwipeToRefresh view :((((((
No idea why.
 
Upvote 0
Top