android: Import the flag to suppress certificate requests
authorTobias Brunner <tobias@strongswan.org>
Thu, 29 Jun 2017 11:00:19 +0000 (13:00 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 3 Jul 2017 08:37:09 +0000 (10:37 +0200)
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;
        }