Fixed the lack of warning when a non trusted SSL certificate is found if the user...
[pub/Android/ownCloud.git] / src / com / owncloud / android / ui / activity / AuthenticatorActivity.java
index 86d9c4b..d13b71e 100644 (file)
@@ -160,10 +160,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
             break;\r
         }\r
         case DIALOG_SSL_VALIDATOR: {\r
-            SslValidatorDialog sslValidator = SslValidatorDialog.newInstance(this, mLastSslFailedResult, this);\r
-            if (sslValidator != null)\r
-                dialog = sslValidator;\r
-            // else, mLastSslFailedResult is not an SSL fail recoverable by accepting the server certificate as reliable; dialog will still be null\r
+            dialog = SslValidatorDialog.newInstance(this, mLastSslFailedResult, this);\r
             break;\r
         }\r
         case DIALOG_CERT_NOT_SAVED: {\r
@@ -540,11 +537,8 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
                 mStatusText = R.string.auth_ssl_general_error_title;\r
                 //mStatusText = R.string.auth_ssl_unverified_server_title;\r
                 mLastSslFailedResult = result;\r
-                showDialog(DIALOG_SSL_VALIDATOR);   // see onCreateDialog(); it does not always show the dialog\r
-                   /*if (InteractiveSslValidatorActivity.isRecoverable(result)) {\r
-                       Intent intent = new Intent(this, InteractiveSslValidatorActivity.class);\r
-                       startActivityForResult(intent, REQUEST_FOR_SSL_CERT);\r
-                   }*/\r
+                if (mLastSslFailedResult.isSslRecoverableException())\r
+                    showDialog(DIALOG_SSL_VALIDATOR); \r
                    break;\r
                    \r
                case HOST_NOT_AVAILABLE:\r