diff options
author | Parménides GV <parmegv@sdf.org> | 2014-08-05 18:00:28 +0200 |
---|---|---|
committer | Parménides GV <parmegv@sdf.org> | 2014-08-05 18:00:28 +0200 |
commit | de429a63c2138a2c29dc5ca89082559b57061691 (patch) | |
tree | 0b388252efa7b04ef12222a425011ff1279abf6d /app/src/main/java | |
parent | 4894b0fa01632db206a597f20daeb5880935733c (diff) |
Add remote-cert-tls server to openvpn options.
Diffstat (limited to 'app/src/main/java')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/EIP.java | 39 |
1 files changed, 13 insertions, 26 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/EIP.java b/app/src/main/java/se/leap/bitmaskclient/EIP.java index 7b2a6d95..2105c67c 100644 --- a/app/src/main/java/se/leap/bitmaskclient/EIP.java +++ b/app/src/main/java/se/leap/bitmaskclient/EIP.java @@ -440,31 +440,10 @@ public final class EIP extends IntentService { this.createVPNProfile(); - setUniqueProfileName(); vpl.addProfile(mVpnProfile); vpl.saveProfile(context, mVpnProfile); vpl.saveProfileList(context); } - - - public String locationAsName() { - try { - return eipDefinition.getJSONObject("locations").getJSONObject(mGateway.getString("location")).getString("name"); - } catch (JSONException e) { - Log.v(TAG,"Couldn't read gateway name for profile creation! Returning original name = " + mName); - e.printStackTrace(); - return (mName != null) ? mName : ""; - } - } - - - /** - * Attempts to create a unique profile name - * based on the location of the gateway. - */ - private void setUniqueProfileName() { - mVpnProfile.mName = mName = locationAsName(); - } /** * Create and attach the VpnProfile to our gateway object @@ -472,17 +451,15 @@ public final class EIP extends IntentService { protected void createVPNProfile(){ try { ConfigParser cp = new ConfigParser(); - Log.d(TAG, configFromEipServiceDotJson()); - Log.d(TAG, caSecretFromSharedPreferences()); - Log.d(TAG, keySecretFromSharedPreferences()); - Log.d(TAG, certSecretFromSharedPreferences()); cp.parseConfig(new StringReader(configFromEipServiceDotJson())); cp.parseConfig(new StringReader(caSecretFromSharedPreferences())); cp.parseConfig(new StringReader(keySecretFromSharedPreferences())); cp.parseConfig(new StringReader(certSecretFromSharedPreferences())); + cp.parseConfig(new StringReader("remote-cert-tls server")); VpnProfile vp = cp.convertProfile(); //vp.mAuthenticationType=VpnProfile.TYPE_STATICKEYS; mVpnProfile = vp; + mVpnProfile.mName = mName = locationAsName(); Log.v(TAG,"Created VPNProfile"); } catch (ConfigParseError e) { // FIXME We didn't get a VpnProfile! Error handling! and log level @@ -612,6 +589,16 @@ public final class EIP extends IntentService { return secret_lines; } - } + + public String locationAsName() { + try { + return eipDefinition.getJSONObject("locations").getJSONObject(mGateway.getString("location")).getString("name"); + } catch (JSONException e) { + Log.v(TAG,"Couldn't read gateway name for profile creation! Returning original name = " + mName); + e.printStackTrace(); + return (mName != null) ? mName : ""; + } + } + } } |