Note that there are some explanatory texts on larger screens.

plurals
  1. POPOST request over HTTPs with Android
    primarykey
    data
    text
    <p>I've got a big problem. I've to POST to an URL some parameters from my application. But when I try to do it within a WebView object it trows me an exception that says "Untrusted Certicate" (the exception is trown by the method in override of the WebViewClient onReceivedSslError()). How can I be able to handshake correctly with the server? Could you please give me some tips? I'm getting crazy... </p> <p>Really, really thanks...</p> <p>EDIT: this is how I've defined my webview</p> <pre><code>webView = (WebView) myFragmentView.findViewById(R.id.webView); webView.setWebViewClient(new WebViewClient(){ @Override public void onPageFinished(WebView view, String string){ Log.debug(tag, "URL pagina terminata :"+webView.getUrl() ); if(progress!=null) if(progress.isShowing()){progress.dismiss();} } @Override public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { Log.error(tag, "ERROR:" + description ); } @Override public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) { super.onReceivedSslError(view, handler, error); Log.error(tag, "SSL Error received: "+ error.getPrimaryError()); handler.proceed(); } }); </code></pre> <p>This is how I've created a postRequest within a WebView</p> <pre><code>webView.postUrl(url, EncodingUtils.getBytes(postParameters, "base64")); </code></pre> <p>This is the LogCat output:</p> <pre><code>SSL Error received: 3 - Untrusted Certificate </code></pre> <p>Now, googling a little bit I've seen that there's the need to check the validity of the certificate and to import the keychain into a local keystore. But the problem is that I'0 don't know where to start... :)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload