diff options
author | Sean Leonard <meanderingcode@aetherislands.net> | 2013-08-13 09:31:41 -0600 |
---|---|---|
committer | Sean Leonard <meanderingcode@aetherislands.net> | 2013-08-13 09:31:41 -0600 |
commit | f721c4fb9ea30fafaede590dec0a0eaa37ccfe42 (patch) | |
tree | a6346ff2a0f9b541ef2d8eb0665ebe6ceb65b4eb | |
parent | 2dc51029679b04599c16ec728404ef2442e35510 (diff) | |
parent | 17903a5221f66d18e90119590c1a29b1f418cafd (diff) |
Merge branch 'bug/provider-down-not-differentiated-from-certificate-error' into develop
-rw-r--r-- | src/se/leap/leapclient/ProviderAPI.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/se/leap/leapclient/ProviderAPI.java b/src/se/leap/leapclient/ProviderAPI.java index d41d7662..dc0b2aa6 100644 --- a/src/se/leap/leapclient/ProviderAPI.java +++ b/src/se/leap/leapclient/ProviderAPI.java @@ -17,6 +17,7 @@ package se.leap.leapclient; import java.io.ByteArrayInputStream; +import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.math.BigInteger; @@ -418,6 +419,9 @@ public class ProviderAPI extends IntentService { displayToast(R.string.malformed_url); } catch(SocketTimeoutException e) { displayToast(R.string.server_is_down_message); + } catch (FileNotFoundException e) { + e.printStackTrace(); + displayToast(R.string.server_is_down_message); } catch (IOException e) { if(provider_url != null) { json_file_content = getStringFromProviderWithCACertAdded(provider_url, danger_on); @@ -458,6 +462,9 @@ public class ProviderAPI extends IntentService { json_string = new Scanner(urlConnection.getInputStream()).useDelimiter("\\A").next(); } catch (MalformedURLException e) { displayToast(R.string.malformed_url); + } catch (FileNotFoundException e) { + e.printStackTrace(); + displayToast(R.string.server_is_down_message); } catch (IOException e) { json_string = getStringFromProviderIgnoringCertificate(string_url); } @@ -510,6 +517,9 @@ public class ProviderAPI extends IntentService { e.printStackTrace(); } catch (UnknownHostException e) { displayToast(R.string.server_is_down_message); + } catch (FileNotFoundException e) { + e.printStackTrace(); + displayToast(R.string.server_is_down_message); } catch (IOException e) { // The downloaded certificate doesn't validate our https connection. if(danger_on) { @@ -563,6 +573,9 @@ public class ProviderAPI extends IntentService { }); string = new Scanner(urlConnection.getInputStream()).useDelimiter("\\A").next(); System.out.println("String ignoring certificate = " + string); + } catch (FileNotFoundException e) { + e.printStackTrace(); + displayToast(R.string.server_is_down_message); } catch (IOException e) { // The downloaded certificate doesn't validate our https connection. e.printStackTrace(); |