summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xres/values/strings.xml3
-rw-r--r--src/se/leap/leapclient/ProviderAPI.java6
2 files changed, 5 insertions, 4 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 35b11b6d..6f06ab64 100755
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -292,7 +292,8 @@
<string name="correctly_downloaded_json_files_message">Your anon cert has been correctly downloaded</string>
<string name="incorrectly_downloaded_certificate_message">Your anon cert was not downloaded</string>
<string name="server_is_down_message">Server is down.</string>
- <string name="malformed_url">It doesn\'t seem to be a LEAP provider</string>
+ <string name="malformed_url">It doesn\'t seem to be a LEAP provider.</string>
+ <string name="certificate_error">This is not a trusted LEAP provider.</string>
<string name="not_valid_password_message">Your password is not well-formed: it should have at least 8 characters.</string>
<string name="succesful_authentication_message">Authentication succeeded.</string>
<string name="authentication_failed_message">Authentication failed.</string>
diff --git a/src/se/leap/leapclient/ProviderAPI.java b/src/se/leap/leapclient/ProviderAPI.java
index b9cbdf24..1bc11495 100644
--- a/src/se/leap/leapclient/ProviderAPI.java
+++ b/src/se/leap/leapclient/ProviderAPI.java
@@ -371,7 +371,7 @@ public class ProviderAPI extends IntentService {
if(provider_url != null && danger_on) {
json_file_content = getStringFromProviderWithoutValidate(provider_url);
}
- displayToast(R.string.malformed_url);
+ displayToast(R.string.certificate_error);
} catch (Exception e) {
if(provider_url != null && danger_on) {
json_file_content = getStringFromProviderWithoutValidate(provider_url);
@@ -405,7 +405,7 @@ public class ProviderAPI extends IntentService {
urlConnection.setHostnameVerifier(hostnameVerifier);
json_string = new Scanner(urlConnection.getInputStream()).useDelimiter("\\A").next();
} catch (MalformedURLException e) {
- Toast.makeText(getApplicationContext(), R.string.malformed_url, Toast.LENGTH_LONG).show();
+ displayToast(R.string.malformed_url);
} catch (IOException e) {
json_string = getStringFromProviderWithCACertAdded(string_url);
}
@@ -469,7 +469,7 @@ public class ProviderAPI extends IntentService {
} catch (IOException e) {
// The downloaded certificate doesn't validate our https connection.
json_file_content = getStringFromProviderIgnoringCertificate(url);
- Toast.makeText(getApplicationContext(), R.string.malformed_url, Toast.LENGTH_LONG).show();
+ displayToast(R.string.certificate_error);
} catch (KeyStoreException e) {
// TODO Auto-generated catch block
e.printStackTrace();