diff options
-rw-r--r-- | main/src/main/java/de/blinkt/openvpn/VpnProfile.java | 2 | ||||
-rw-r--r-- | main/src/main/java/de/blinkt/openvpn/fragments/Settings_Authentication.java | 13 | ||||
-rwxr-xr-x | main/src/main/res/values/strings.xml | 1 |
3 files changed, 11 insertions, 5 deletions
diff --git a/main/src/main/java/de/blinkt/openvpn/VpnProfile.java b/main/src/main/java/de/blinkt/openvpn/VpnProfile.java index b2246b8c..4b483b8f 100644 --- a/main/src/main/java/de/blinkt/openvpn/VpnProfile.java +++ b/main/src/main/java/de/blinkt/openvpn/VpnProfile.java @@ -438,7 +438,7 @@ public class VpnProfile implements Serializable { if (mAuthenticationType != TYPE_STATICKEYS) { if (mCheckRemoteCN) { if (mRemoteCN == null || mRemoteCN.equals("")) - cfg += "verify-x509-name " + mServerName + " name\n"; + cfg += "verify-x509-name " + mConnections[0].mServerName + " name\n"; else switch (mX509AuthType) { diff --git a/main/src/main/java/de/blinkt/openvpn/fragments/Settings_Authentication.java b/main/src/main/java/de/blinkt/openvpn/fragments/Settings_Authentication.java index a286a688..270b4ddf 100644 --- a/main/src/main/java/de/blinkt/openvpn/fragments/Settings_Authentication.java +++ b/main/src/main/java/de/blinkt/openvpn/fragments/Settings_Authentication.java @@ -135,10 +135,15 @@ public class Settings_Authentication extends OpenVpnPreferencesFragment implemen @SuppressWarnings("unchecked") String dn = ((Pair<Integer, String>) newValue).second; - if ("".equals(dn)) - preference.setSummary(getX509String(VpnProfile.X509_VERIFY_TLSREMOTE_RDN, mProfile.mServerName)); - else - preference.setSummary(getX509String(authtype,dn)); + if ("".equals(dn)) { + if (mProfile.mConnections.length > 0) { + preference.setSummary(getX509String(VpnProfile.X509_VERIFY_TLSREMOTE_RDN, mProfile.mConnections[0].mServerName)); + } else { + preference.setSummary(R.string.no_remote_defined); + } + } else { + preference.setSummary(getX509String(authtype, dn)); + } } else if (preference == mCipher || preference == mAuth) { preference.setSummary((CharSequence) newValue); diff --git a/main/src/main/res/values/strings.xml b/main/src/main/res/values/strings.xml index aeb03712..b692541d 100755 --- a/main/src/main/res/values/strings.xml +++ b/main/src/main/res/values/strings.xml @@ -345,5 +345,6 @@ <string name="advanced_settings">Advanced Settings</string> <string name="payload_options">Payload options</string> <string name="tls_settings">TLS Settings</string> + <string name="no_remote_defined">No remote defined</string> </resources> |