Android WebView blocks redirect from https to http

前端 未结 4 2064
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-28 19:30

I have a solution where my Android WebView needs to first open a https url, then it will be redirected to a http url (it might be trying a http POST from the https site). Th

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-28 19:44

    You can ignore ssl error by overriding onReceivedSslError() method.

    @Override
    public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
        handler.proceed(); // Ignore SSL certificate errors
    }
    

    Hope it will be work for you.

提交回复
热议问题