We have a hybrid android app based on JQueryMobile [with all JS/CSS/HTML packaged inside APK]. This app is able to fetch json data from server [with RESTful interface] using JQM ajax call [for http url] however when we are trying to do the same thing using https it fails.

我们有一个基于JQueryMobile的混合Android应用程序[所有JS / CSS / HTML打包在APK]。这个应用程序能够使用JQM ajax调用[用于http url]从服务器[使用RESTful接口]获取json数据,但是当我们尝试使用https执行相同的操作时,它会失败。

Another bit is: We have used bouncycastle based certificate to enable TLS [on server] which is working fine with native android calls [using java].

另一点是:我们使用了基于bouncycastle的证书来启用TLS [在服务器上],这对于本机android调用[使用java]工作正常。

Now we are confused as to why it is working with http however not with https. Any hint in this regard will be appreciated. We don't think it is something to do with CORS/XOR problem as our ajax http calls are working fine.

现在我们很困惑为什么它使用http但不使用https。在这方面的任何暗示将不胜感激。我们认为这与CORS / XOR问题无关,因为我们的ajax http调用工作正常。

1 个解决方案

#1


0

I'm assuming you're using the Android WebView class? If so, check what the error is by implementing this method:

我假设你正在使用Android WebView类?如果是这样,请通过实现此方法检查错误:

 webView.setWebViewClient(new WebViewClient() {
 public void onReceivedSslError (WebView view, SslErrorHandler handler, SslError error) {
     Log.d("ssl_error", "The error is: " + error);
 }

With that code, you can see what error, if any, is causing the blank page. If it's an error that you can accept, then replace the Log.d line with handler.proceed(); (with an if condition to verify that it's the same error). Ideally, you'd correct whatever issue is causing it however.

使用该代码,您可以查看导致空白页面的错误(如果有)。如果这是一个你可以接受的错误,那么用handler.proceed()替换Log.d行; (使用if条件来验证它是否是相同的错误)。理想情况下,您可以更正导致它的任何问题。

更多相关文章

  1. 第三部分:Android 应用程序接口指南---第二节:UI---第六章 对话框
  2. android 百度地图app key 230 错误解决
  3. Android Filetransfer错误码3
  4. Android棉花糖“不能播放这个视频”错误
  5. 如何将本机应用程序(android)与phonegap应用程序集成
  6. 为什么我的Android应用程序偶尔可以非常快地耗尽电池?
  7. 如何在android 5.0(L)中运行应用程序活动名称?
  8. Android应用程序启动过程上
  9. ViewPager中的错误片段接收onContextItemSelected调用

随机推荐

  1. android笔记--android的进程与线程
  2. Android性能分析工具Systrace和TraceView
  3. Android(安卓)App 开源项目使用统计
  4. Android学习笔记19:ImageView实现图片适屏
  5. android 静默安装,含获取各种应用信息方法
  6. Android手机AP模式下本机IP
  7. Android(安卓)Hal 分析
  8. Android注解支持(Support Annotations)详
  9. Android音频架构性能分析
  10. [置顶] linux2.6驱动开发系列教程