0

I'm new to android and in my app, I need to get connection to an https for payment action and here's how my webview currently looks like when I try to make connection.

webview fails

I've looked up on the web for solutions to loading https via overriding onReceivedSslError method to ignore the error and proceed onwards. So, I have done so as the following.

Here's my webview getting its settings:

web = (WebView)findViewById(R.id.web); // setting WebViewClient web.setWebViewClient(new WebViewClientClass()); web.getSettings().setDomStorageEnabled(true); web.getSettings().setJavaScriptEnabled(true); web.loadUrl(orderSheetUrl); 

where orderSheetUrl is the https url to which my payment action takes the user to.

Below is my WebViewClient class:

private class WebViewClientClass extends WebViewClient { @Override public void onPageStarted(WebView view, String url, Bitmap favicon) { Log.d("WebView", "onPageStarted " + url); } @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { Log.d("WebView", "in shouldOverrideUrlLoading"); view.loadUrl(url); return true; } @Override public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) { Log.d("WebView", "onReceivedSslError"); handler.proceed(); // Ignore SSL certificate errors } @Override public void onPageFinished(WebView view, String url) { Log.d("WebView", "onPageFinished " + url); } } 

The problem here is then I try to load the link, but find in my log that only the logs for onPageStarted and onPageFinished is being called.

Here's my logs:

12-13 17:06:31.760 8694-8694/? D/WebView: onPageStarted :"https://alpha-bill.payco.com/easyLogin/201512132004116802?inAppYn=Y" 12-13 17:06:31.760 8694-8694/? D/WebView: onPageFinished :"https://alpha-bill.payco.com/easyLogin/201512132004116802?inAppYn=Y" 12-13 17:06:31.790 8694-9927/? E/Adreno-ES20: <check_framebuffer_attachment:854>: Invalid texture format! Returning error! 12-13 17:06:31.790 8694-9927/? E/Adreno-ES20: <check_framebuffer_object_status:1237>: Framebuffer color attachment incomplete. Returning GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT! 12-13 17:06:31.800 8694-8694/? W/cr.BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 8694 12-13 17:06:31.810 8694-8694/? W/cr.BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 8694 12-13 17:06:32.180 8694-8795/? E/Adreno-ES20: <check_framebuffer_attachment:854>: Invalid texture format! Returning error! 12-13 17:06:32.180 8694-8795/? E/Adreno-ES20: <check_framebuffer_object_status:1237>: Framebuffer color attachment incomplete. Returning GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT! 

I really don't get why the onReceivedSslError method is not called even when I access a url starting with https, which from my understanding should require a certificate to have an access.

Have I done something wrong with implementing my WebViewClient? Or is there any other way around this? Thanks in advance for the help.

P.S. my target API is 23 and minimum is 15.

1
  • check if the time is set properly Commented Dec 13, 2015 at 9:36

1 Answer 1

2

From the documentation:

Notify the host application that an SSL error occurred while loading a resource.

So why should it be called when there is no error?

Sign up to request clarification or add additional context in comments.

3 Comments

I've edited my question. I forgot to mention that my webview fails to load and does not give ssl errors so I'm wondering what error that is.
could it be that you send the " characters as part of the URL?
Ahhhhh stupid me :( Thanks for the help! It was indeed passing url with the quotes!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.