summaryrefslogtreecommitdiff
path: root/app/src/production/java
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2018-02-20 14:25:56 +0100
committercyBerta <cyberta@riseup.net>2018-02-20 14:25:56 +0100
commit8256666a9981ac347e4a6e769e1981007c408b3a (patch)
tree899dea255868263e0f71f75b7cbdee3cb0b629c7 /app/src/production/java
parent2bb5c64efda2cefcb2f9768f32be2b2936edadef (diff)
#8853 fix failing vpn cert download callback for insecure flavor and use new provider method to build the api url
Diffstat (limited to 'app/src/production/java')
-rw-r--r--app/src/production/java/se/leap/bitmaskclient/ProviderApiManager.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/src/production/java/se/leap/bitmaskclient/ProviderApiManager.java b/app/src/production/java/se/leap/bitmaskclient/ProviderApiManager.java
index e5ee6c49..de50c170 100644
--- a/app/src/production/java/se/leap/bitmaskclient/ProviderApiManager.java
+++ b/app/src/production/java/se/leap/bitmaskclient/ProviderApiManager.java
@@ -34,6 +34,7 @@ import se.leap.bitmaskclient.eip.EIP;
import static android.text.TextUtils.isEmpty;
import static se.leap.bitmaskclient.Constants.BROADCAST_RESULT_KEY;
+import static se.leap.bitmaskclient.Constants.PROVIDER_KEY;
import static se.leap.bitmaskclient.Constants.PROVIDER_VPN_CERTIFICATE;
import static se.leap.bitmaskclient.ProviderAPI.ERRORS;
import static se.leap.bitmaskclient.ProviderSetupFailedDialog.DOWNLOAD_ERRORS.ERROR_CERTIFICATE_PINNING;
@@ -84,6 +85,7 @@ public class ProviderApiManager extends ProviderApiManagerBase {
//provider details invalid
if (currentDownload.containsKey(ERRORS)) {
+ currentDownload.putParcelable(PROVIDER_KEY, provider);
return currentDownload;
}
@@ -177,9 +179,7 @@ public class ProviderApiManager extends ProviderApiManagerBase {
protected Bundle updateVpnCertificate(Provider provider) {
Bundle result = new Bundle();
try {
- JSONObject providerJson = provider.getDefinition();
- String providerMainUrl = providerJson.getString(Provider.API_URL);
- URL newCertStringUrl = new URL(providerMainUrl + "/" + providerJson.getString(Provider.API_VERSION) + "/" + PROVIDER_VPN_CERTIFICATE);
+ URL newCertStringUrl = new URL(provider.getApiUrlWithVersion() + "/" + PROVIDER_VPN_CERTIFICATE);
String certString = downloadWithProviderCA(provider.getCaCert(), newCertStringUrl.toString());
if (ConfigHelper.checkErroneousDownload(certString)) {
@@ -194,7 +194,7 @@ public class ProviderApiManager extends ProviderApiManagerBase {
}
}
return loadCertificate(provider, certString);
- } catch (IOException | JSONException e) {
+ } catch (IOException e) {
// TODO try to get Provider Json
setErrorResult(result, downloading_vpn_certificate_failed, null);
e.printStackTrace();