Added SSL Validation Override and CA Selection

- Added fields to login page to a) disable ssl validation or b) select
  a custom Certificate Authority certificate to use with the server.

- Changed visibility of widgets on login page from INVISIBLE to GONE so
  they don't take up space while hidden (since this was causing weird
  spacing issues with the new fields).

- Added state to settings to store ssl validation choice or certificate
  data.

- Added fields to various HTTP methods to disable ssl validation or set
  valid certificate authority if either setting is enabled.
This commit is contained in:
Galen Abell
2018-11-07 17:28:25 -05:00
parent 97ab5a6871
commit 2d14ef1b6f
10 changed files with 362 additions and 45 deletions

View File

@@ -34,6 +34,8 @@ public class Settings {
public void clear() {
url(null);
token(null);
validateSSL(true);
cert(null);
}
public void user(String name, boolean admin) {
@@ -57,4 +59,13 @@ public class Settings {
public void serverVersion(String version) {
sharedPreferences.edit().putString("version", version).apply();
}
// Default to always validating SSL.
public boolean validateSSL() { return sharedPreferences.getBoolean("validateSSL", true); }
public void validateSSL(boolean validateSSL) { sharedPreferences.edit().putBoolean("validateSSL", validateSSL).apply(); }
public String cert() { return sharedPreferences.getString("cert", null); }
public void cert(String cert) { sharedPreferences.edit().putString("cert", cert).apply(); }
}