GithubHelp home page GithubHelp logo

Comments (2)

Vaporexpress avatar Vaporexpress commented on July 20, 2024

Hi. FYI Google rejected my App until I added this code:
On "public class InAppBrowserClient extends WebViewClient":

        // Rejected by Google Play - Failed to validate the certificate chain
        @Override
        public void onReceivedSslError(WebView view, final SslErrorHandler handler, SslError error) {
            final AlertDialog.Builder builder = new AlertDialog.Builder(new ContextThemeWrapper(webView.getContext(), R.style.AlertDialogCustom));
            String message = "SSL Certificate error.";
            switch (error.getPrimaryError()) {
                case SslError.SSL_NOTYETVALID:
                    message = "The certificate is not yet valid.";
                    break;
                case SslError.SSL_EXPIRED:
                    message = "The certificate has expired.";
                    break;
                case SslError.SSL_IDMISMATCH:
                    message = "Hostname mismatch.";
                    break;
                case SslError.SSL_UNTRUSTED:
                    message = "The certificate authority is not trusted.";
                    break;
                case SslError.SSL_DATE_INVALID:
                    message = "The date of the certificate is invalid.";
                    break;
                case SslError.SSL_INVALID:
                    message = "A generic error occurred.";
                    break;
                case SslError.SSL_MAX_ERROR: /* Deprecated in API level 14*/
                    message = "The number of different SSL errors.";
                    break;
            }
            message += " Do you want to continue anyway?";

            builder.setTitle("SSL Certificate Error");
            builder.setMessage(message);
            builder.setPositiveButton("continuar", new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    handler.proceed();
                }
            });
            builder.setNegativeButton("cancelar", new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    handler.cancel();
                    closeDialog();
                }
            });
            final AlertDialog dialog = builder.create();
            dialog.show();
        }

from cordova-plugin-inappbrowser.

tonetechnician avatar tonetechnician commented on July 20, 2024

Hi guys,

I'm wondering if anyone has had any further experience with this? I have local area network system that intends to use a phone app as a controller. I require access to the phone's gyro and accelerometer so, as far as I can tell, I need to use https to gain access to this.

Since it's a local area server that the phone is interacting with I need to use a self-signed certificate, and am unable to use a CA for two reasons:

  1. The app could be used on networks not connected to the internet
  2. My server IP can change across networks.

The thing I don't understand is that the app works as it should when I load the apk locally (using debug), but when I upload a release to the app store and download it, it doesn't work, and I'm rather given a popup message "The connection the server was unsuccessful".

Has anyone had any similar experience? Or possibly any sort of work around for it? Would help me so much! So far I've sent a message to Google Play Store and hoping to get a response from them as well. Will post here as well once I have feedback.

from cordova-plugin-inappbrowser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.