Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am working on app that will connect user with available open WIFIs by providing their landing pages (having login option) in the app. Google is showing alert for using onReceivedSslError() in WebView for loading Wifi's landing page in the app.

If I remove this method then link will not work. In order to make it functional I need to add the domain name in the network_security_config.xml file but I do not know which link will be shown by wifi's vendors as it is not in my control. This insist me to use onReceivedSslError() method in Webview. I am showing alert dialog inside onReceivedSslError() to ask user if he wants to continue or not.

 AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder.setMessage("SSL Certificate Verification!
Please click on CONTINUE to open login 
page of selected Wifi");
        builder.setPositiveButton("continue", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                handler.proceed();
            }
        });
        builder.setNegativeButton("cancel", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                handler.cancel();
                finish();
            }
        });
        final AlertDialog dialog = builder.create();
        dialog.show();` 

Error getting inside onReceivedSslError()

error.getPrimaryError() : 3 SSL_UNTRUSTED

I have tried this too https://www.rgagnon.com/javadetails/java-fix-certificate-problem-in-HTTPS.html but again not working .

Any available link is not solving my issue. Kindly guide me. Thanks in advance

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
948 views
Welcome To Ask or Share your Answers For Others

1 Answer

Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...