瀏覽代碼

Fixed false error message and lack of recheck when a server certificate is explicitly accepted by the user in the login view

David A. Velasco 12 年之前
父節點
當前提交
04803ae879

+ 1 - 1
src/com/owncloud/android/authentication/AuthenticatorActivity.java

@@ -1270,7 +1270,7 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
      * Called from SslValidatorDialog when a new server certificate was correctly saved.
      */
     public void onSavedCertificate() {
-        mOperationThread = mOcServerChkOperation.retry(this, mHandler);                
+        checkOcServer();
     }
 
     /**

+ 8 - 1
src/com/owncloud/android/ui/dialog/SslValidatorDialog.java

@@ -18,6 +18,7 @@
 package com.owncloud.android.ui.dialog;
 
 import java.io.IOException;
+import java.security.GeneralSecurityException;
 import java.security.KeyStoreException;
 import java.security.NoSuchAlgorithmException;
 import java.security.cert.CertificateException;
@@ -111,7 +112,13 @@ public class SslValidatorDialog extends Dialog {
                             else
                                 Log_OC.d(TAG, "Nobody there to notify the certificate was saved");
                             
-                        } catch (Exception e) {
+                        } catch (GeneralSecurityException e) {
+                            dismiss();
+                            if (mListener != null)
+                                mListener.onFailedSavingCertificate();
+                            Log_OC.e(TAG, "Server certificate could not be saved in the known servers trust store ", e);
+                            
+                        } catch (IOException e) {
                             dismiss();
                             if (mListener != null)
                                 mListener.onFailedSavingCertificate();