Fixed false error message and lack of recheck when a server certificate is explicitly...
authorDavid A. Velasco <dvelasco@solidgear.es>
Wed, 26 Jun 2013 10:45:35 +0000 (12:45 +0200)
committerDavid A. Velasco <dvelasco@solidgear.es>
Wed, 26 Jun 2013 10:45:35 +0000 (12:45 +0200)
src/com/owncloud/android/authentication/AuthenticatorActivity.java
src/com/owncloud/android/ui/dialog/SslValidatorDialog.java

index 5118552..6eae48f 100644 (file)
@@ -1270,7 +1270,7 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
      * Called from SslValidatorDialog when a new server certificate was correctly saved.\r
      */\r
     public void onSavedCertificate() {\r
-        mOperationThread = mOcServerChkOperation.retry(this, mHandler);                \r
+        checkOcServer();\r
     }\r
 \r
     /**\r
index a5766ee..6ae4156 100644 (file)
@@ -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();