diff options
author | Arne Schwabe <arne@rfc2549.org> | 2014-11-25 11:14:17 +0100 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2014-11-25 11:14:17 +0100 |
commit | f97e14bf30624fd5b95571399b4a74f353ed2da4 (patch) | |
tree | 003501a1ecd95f27c75d544a9850b725cc2abfbe | |
parent | 20b4f006493df4325be34d83d78c0df870207b8d (diff) |
Fix multiple connection definitions with tls-remote check
--HG--
extra : rebase_source : 6bde5fa992982adfef2b82bb058cb13d55825f8f
-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> |