diff --git a/src/frontends/android/app/src/main/java/org/strongswan/android/ui/VpnProfileControlActivity.java b/src/frontends/android/app/src/main/java/org/strongswan/android/ui/VpnProfileControlActivity.java
index a7b39b6ac..9ff07175e 100644
--- a/src/frontends/android/app/src/main/java/org/strongswan/android/ui/VpnProfileControlActivity.java
+++ b/src/frontends/android/app/src/main/java/org/strongswan/android/ui/VpnProfileControlActivity.java
@@ -70,6 +70,7 @@ public class VpnProfileControlActivity extends AppCompatActivity
private static final String WAITING_FOR_RESULT = "WAITING_FOR_RESULT";
private static final String PROFILE_NAME = "PROFILE_NAME";
private static final String PROFILE_REQUIRES_PASSWORD = "REQUIRES_PASSWORD";
+ private static final String PROFILE_CERTIFICATE_MISSING = "CERTIFICATE_MISSING";
private static final String PROFILE_RECONNECT = "RECONNECT";
private static final String PROFILE_DISCONNECT = "DISCONNECT";
private static final String DIALOG_TAG = "Dialog";
@@ -332,6 +333,8 @@ public class VpnProfileControlActivity extends AppCompatActivity
profileInfo.putString(VpnProfileDataSource.KEY_USERNAME, profile.getUsername());
profileInfo.putString(VpnProfileDataSource.KEY_PASSWORD, profile.getPassword());
profileInfo.putBoolean(PROFILE_REQUIRES_PASSWORD, profile.getVpnType().has(VpnTypeFeature.USER_PASS));
+ profileInfo.putBoolean(PROFILE_CERTIFICATE_MISSING, profile.getVpnType().has(VpnTypeFeature.CERTIFICATE) &&
+ profile.getUserCertificateAlias() == null);
profileInfo.putString(PROFILE_NAME, profile.getName());
removeFragmentByTag(DIALOG_TAG);
@@ -355,6 +358,13 @@ public class VpnProfileControlActivity extends AppCompatActivity
*/
private void startVpnProfile(Bundle profileInfo)
{
+ if (profileInfo.getBoolean(PROFILE_CERTIFICATE_MISSING))
+ {
+ CertificateRequiredDialog dialog = new CertificateRequiredDialog();
+ dialog.setArguments(profileInfo);
+ dialog.show(getSupportFragmentManager(), DIALOG_TAG);
+ return;
+ }
if (profileInfo.getBoolean(PROFILE_REQUIRES_PASSWORD) &&
profileInfo.getString(VpnProfileDataSource.KEY_PASSWORD) == null)
{
@@ -621,6 +631,36 @@ public class VpnProfileControlActivity extends AppCompatActivity
}
}
+ /**
+ * Class that displays a dialog warning about a missing certificate.
+ */
+ public static class CertificateRequiredDialog extends AppCompatDialogFragment
+ {
+ @Override
+ public Dialog onCreateDialog(Bundle savedInstanceState)
+ {
+ final Bundle profileInfo = getArguments();
+
+ AlertDialog.Builder builder = new AlertDialog.Builder(getActivity())
+ .setTitle(R.string.certificate_required_title)
+ .setMessage(R.string.certificate_required_text)
+ .setNegativeButton(android.R.string.cancel, (dialog, which) -> getActivity().finish())
+ .setPositiveButton(R.string.edit_profile, (dialog, which) -> {
+ Intent editIntent = new Intent(getActivity(), VpnProfileDetailActivity.class);
+ editIntent.putExtra(VpnProfileDataSource.KEY_UUID, profileInfo.getString(VpnProfileDataSource.KEY_UUID));
+ startActivity(editIntent);
+ getActivity().finish();
+ });
+ return builder.create();
+ }
+
+ @Override
+ public void onCancel(DialogInterface dialog)
+ {
+ getActivity().finish();
+ }
+ }
+
/**
* Class that displays a warning before asking the user to add the app to the
* device's power whitelist.
diff --git a/src/frontends/android/app/src/main/res/values-de/strings.xml b/src/frontends/android/app/src/main/res/values-de/strings.xml
index 3691a598c..c282004af 100644
--- a/src/frontends/android/app/src/main/res/values-de/strings.xml
+++ b/src/frontends/android/app/src/main/res/values-de/strings.xml
@@ -234,6 +234,8 @@
Wiederholen abbrechen
Akku-Optimierung deaktivieren
Bitte den nächsten Dialog bestätigen, um die App auf die weisse Liste für Akku-Optimierung zu setzen, so dass sie NAT keepalives und Rekeyings zeitlich korrekt planen kann, um konstant erreichbar zu bleiben während die VPN-Verbindung besteht.
+ Benutzer-Zertifikat benötigt
+ Bitte bearbeiten Sie das VPN Profil, um eines auszuwählen.
VPN umschalten
diff --git a/src/frontends/android/app/src/main/res/values-pl/strings.xml b/src/frontends/android/app/src/main/res/values-pl/strings.xml
index 4a3b92201..82d965536 100644
--- a/src/frontends/android/app/src/main/res/values-pl/strings.xml
+++ b/src/frontends/android/app/src/main/res/values-pl/strings.xml
@@ -236,6 +236,8 @@
Cancel retry
Disable battery optimizations
Please confirm the next dialog to add the app to the device\'s power whitelist so it can ignore battery optimizations and schedule NAT keep-alives and rekeyings accurately in order to constantly keep reachable while the VPN is established.
+ User certificate required
+ Please edit the VPN profile to select one.
Toggle VPN
diff --git a/src/frontends/android/app/src/main/res/values-ru/strings.xml b/src/frontends/android/app/src/main/res/values-ru/strings.xml
index bb7173e92..ac09e3e4c 100644
--- a/src/frontends/android/app/src/main/res/values-ru/strings.xml
+++ b/src/frontends/android/app/src/main/res/values-ru/strings.xml
@@ -230,6 +230,8 @@
Cancel retry
Disable battery optimizations
Please confirm the next dialog to add the app to the device\'s power whitelist so it can ignore battery optimizations and schedule NAT keep-alives and rekeyings accurately in order to constantly keep reachable while the VPN is established.
+ User certificate required
+ Please edit the VPN profile to select one.
Toggle VPN
diff --git a/src/frontends/android/app/src/main/res/values-uk/strings.xml b/src/frontends/android/app/src/main/res/values-uk/strings.xml
index c92f170b2..a819bc83e 100644
--- a/src/frontends/android/app/src/main/res/values-uk/strings.xml
+++ b/src/frontends/android/app/src/main/res/values-uk/strings.xml
@@ -231,6 +231,8 @@
Cancel retry
Disable battery optimizations
Please confirm the next dialog to add the app to the device\'s power whitelist so it can ignore battery optimizations and schedule NAT keep-alives and rekeyings accurately in order to constantly keep reachable while the VPN is established.
+ User certificate required
+ Please edit the VPN profile to select one.
Toggle VPN
diff --git a/src/frontends/android/app/src/main/res/values-zh-rCN/strings.xml b/src/frontends/android/app/src/main/res/values-zh-rCN/strings.xml
index d2b21f227..a7ad193c7 100644
--- a/src/frontends/android/app/src/main/res/values-zh-rCN/strings.xml
+++ b/src/frontends/android/app/src/main/res/values-zh-rCN/strings.xml
@@ -230,6 +230,8 @@
取消重试
禁用电池优化
请确认下一个对话框,将应用程序添加到设备的电源白名单中,这样它就可以忽略电池优化,并准确地安排NAT保持有效和重新键入,以便在建立VPN时始终保持可访问性。
+ User certificate required
+ Please edit the VPN profile to select one.
切换VPN
diff --git a/src/frontends/android/app/src/main/res/values-zh-rTW/strings.xml b/src/frontends/android/app/src/main/res/values-zh-rTW/strings.xml
index 6c74fc786..533167584 100644
--- a/src/frontends/android/app/src/main/res/values-zh-rTW/strings.xml
+++ b/src/frontends/android/app/src/main/res/values-zh-rTW/strings.xml
@@ -230,6 +230,8 @@
Cancel retry
Disable battery optimizations
Please confirm the next dialog to add the app to the device\'s power whitelist so it can ignore battery optimizations and schedule NAT keep-alives and rekeyings accurately in order to constantly keep reachable while the VPN is established.
+ User certificate required
+ Please edit the VPN profile to select one.
Toggle VPN
diff --git a/src/frontends/android/app/src/main/res/values/strings.xml b/src/frontends/android/app/src/main/res/values/strings.xml
index 667375864..417463606 100644
--- a/src/frontends/android/app/src/main/res/values/strings.xml
+++ b/src/frontends/android/app/src/main/res/values/strings.xml
@@ -234,6 +234,8 @@
Cancel retry
Disable battery optimizations
Please confirm the next dialog to add the app to the device\'s power whitelist so it can ignore battery optimizations and schedule NAT keep-alives and rekeyings accurately in order to constantly keep reachable while the VPN is established.
+ User certificate required
+ Please edit the VPN profile to select one.
Toggle VPN