diff options
author | Arne Schwabe <arne@rfc2549.org> | 2021-10-20 14:44:31 +0200 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2021-10-20 14:44:31 +0200 |
commit | 1e791c969df77a424d5d1561cd839aee5b6f00a0 (patch) | |
tree | 6f12335d34477a12867c4c1856eacd974f97cbdf | |
parent | 33218dd7a52b63e6a2e83a57dff8308a18087106 (diff) |
Fix writing tls profile to static key config and few cleanups
4 files changed, 4 insertions, 6 deletions
diff --git a/main/src/main/java/de/blinkt/openvpn/VpnProfile.java b/main/src/main/java/de/blinkt/openvpn/VpnProfile.java index d13ac7fa..af65873d 100644 --- a/main/src/main/java/de/blinkt/openvpn/VpnProfile.java +++ b/main/src/main/java/de/blinkt/openvpn/VpnProfile.java @@ -386,7 +386,7 @@ public class VpnProfile implements Serializable, Cloneable { if (mUseLegacyProvider) cfg.append("provider legacy:default\n"); - if (!TextUtils.isEmpty(mTlSCertProfile)) + if (!TextUtils.isEmpty(mTlSCertProfile) && mAuthenticationType != TYPE_STATICKEYS) cfg.append(String.format("tls-cert-profile %s\n", mTlSCertProfile)); } else { cfg.append("# Config for OpenVPN 3 C++\n"); diff --git a/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java b/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java index cb78784c..09730245 100644 --- a/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java +++ b/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java @@ -614,7 +614,7 @@ public class OpenVPNService extends VpnService implements StateListener, Callbac // Open the Management Interface if (!useOpenVPN3) { - // start a Thread that handles incoming messages of the managment socket + // start a Thread that handles incoming messages of the management socket OpenVpnManagementThread ovpnManagementThread = new OpenVpnManagementThread(mProfile, this); if (ovpnManagementThread.openManagementInterface(this)) { Thread mSocketManagerThread = new Thread(ovpnManagementThread, "OpenVPNManagementThread"); diff --git a/main/src/main/java/de/blinkt/openvpn/core/OpenVpnManagementThread.java b/main/src/main/java/de/blinkt/openvpn/core/OpenVpnManagementThread.java index f72c759f..e32aabe3 100644 --- a/main/src/main/java/de/blinkt/openvpn/core/OpenVpnManagementThread.java +++ b/main/src/main/java/de/blinkt/openvpn/core/OpenVpnManagementThread.java @@ -131,6 +131,7 @@ public class OpenVpnManagementThread implements Runnable, OpenVPNManagement { } catch (IOException e) {
// wait 300 ms before retrying
try {
+ //noinspection BusyWait
Thread.sleep(300);
} catch (InterruptedException ignored) {
}
@@ -216,8 +217,6 @@ public class OpenVpnManagementThread implements Runnable, OpenVPNManagement { pendingInput += input;
pendingInput = processInput(pendingInput);
-
-
}
} catch (IOException e) {
if (!e.getMessage().equals("socket closed") && !e.getMessage().equals("Connection reset by peer"))
diff --git a/main/src/ui/java/de/blinkt/openvpn/fragments/Settings_Fragment.java b/main/src/ui/java/de/blinkt/openvpn/fragments/Settings_Fragment.java index f29f2063..42ad4d29 100644 --- a/main/src/ui/java/de/blinkt/openvpn/fragments/Settings_Fragment.java +++ b/main/src/ui/java/de/blinkt/openvpn/fragments/Settings_Fragment.java @@ -21,11 +21,10 @@ public abstract class Settings_Fragment extends Fragment { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); String profileUuid = getArguments().getString(getActivity().getPackageName() + ".profileUUID"); - mProfile= ProfileManager.get(getActivity(), profileUuid); + mProfile = ProfileManager.get(getActivity(), profileUuid); getActivity().setTitle(getString(R.string.edit_profile_title, mProfile.getName())); } - @Override public void onPause() { super.onPause(); |