浏览代码

Add check of SSL unverified to show a dialog

Juan Carlos González Cabrero 9 年之前
父节点
当前提交
50f829a250
共有 2 个文件被更改,包括 14 次插入7 次删除
  1. 1 1
      owncloud-android-library
  2. 13 6
      src/com/owncloud/android/ui/activity/FileDisplayActivity.java

+ 1 - 1
owncloud-android-library

@@ -1 +1 @@
-Subproject commit 39e3ddaa07b0943b034b34a84a33b4dc4c7475d0
+Subproject commit 573afa15382b67cc84f67fc9a7b2329a72ecb352

+ 13 - 6
src/com/owncloud/android/ui/activity/FileDisplayActivity.java

@@ -1031,14 +1031,21 @@ public class FileDisplayActivity extends HookActivity implements
                                         .equals(event));
 
                         if (RefreshFolderOperation.EVENT_SINGLE_FOLDER_CONTENTS_SYNCED.
-                                equals(event) &&/// TODO refactor and make common
+                            equals(event) &&/// TODO refactor and make common
 
-                                synchResult != null && !synchResult.isSuccess() &&
-                                (ResultCode.UNAUTHORIZED.equals(synchResult.getCode()) ||
-                                        (synchResult.isException() && synchResult.getException()
-                                                instanceof AuthenticatorException))) {
+                            synchResult != null && !synchResult.isSuccess()) {
 
-                            requestCredentialsUpdate(context);
+                            if(ResultCode.UNAUTHORIZED.equals(synchResult.getCode()) ||
+                                synchResult.isIdPRedirection() ||
+                                (synchResult.isException() && synchResult.getException()
+                                    instanceof AuthenticatorException)) {
+
+                                requestCredentialsUpdate(context);
+
+                            } else if(RemoteOperationResult.ResultCode.SSL_RECOVERABLE_PEER_UNVERIFIED.equals(synchResult.getCode())) {
+
+                                showUntrustedCertDialog(synchResult);
+                            }
 
                         }