user1302569
user1302569

Reputation: 7191

Android webview and https

I have a question. I have application for 3.0 api. I am using webview to show page. I have a question if webview correctly use https? I want to create shop and I want to use https. If are any problems with that protocol?

Upvotes: 1

Views: 296

Answers (2)

JustDanyul
JustDanyul

Reputation: 14044

You should be alright, but if you don't have a certificate from a trusted authority you will need to somehow handle this.

The following snipped of code

webview = (WebView) findViewById(R.id.webviewId);
webview.setWebViewClient(new WebViewClient() {
    public void onReceivedSslError (WebView view, 
        SslErrorHandler handler, SslError error) {
            handler.proceed() ;
    }
}

will display a dialog to the user, verifying if they trust your site and wish to continue or not.

Upvotes: 2

Marcos Placona
Marcos Placona

Reputation: 21720

We have been using HTTPS with webviews for one of our applications with no problems. We process payments through it, so you're safe to use it.

Just make sure you're using a certificate from a trusted authority so you don't need any hacks.

Upvotes: 1

Related Questions