android: Import the flag to suppress certificate requests
[strongswan.git] / src / frontends / android / app / src / main / java / org / strongswan / android / ui / VpnProfileImportActivity.java
index 0625b39..5cfcf48 100644 (file)
@@ -463,6 +463,7 @@ public class VpnProfileImportActivity extends AppCompatActivity
                        return null;
                }
                ParsedVpnProfile profile = new ParsedVpnProfile();
+               Integer flags = 0;
 
                profile.setUUID(uuid);
                profile.setName(obj.getString("name"));
@@ -475,6 +476,11 @@ public class VpnProfileImportActivity extends AppCompatActivity
                profile.setRemoteId(remote.optString("id", null));
                profile.Certificate = decodeBase64(remote.optString("cert", null));
 
+               if (remote.optBoolean("certreq", false))
+               {
+                       flags |= VpnProfile.FLAGS_SUPPRESS_CERT_REQS;
+               }
+
                JSONObject local = obj.optJSONObject("local");
                if (local != null)
                {
@@ -517,6 +523,7 @@ public class VpnProfileImportActivity extends AppCompatActivity
                        profile.setSelectedApps(excludedApps);
                        profile.setSelectedAppsHandling(SelectedAppsHandling.SELECTED_APPS_EXCLUDE);
                }
+               profile.setFlags(flags);
                return profile;
        }