From 71f0b807670901dca8698deba1e21dd5b2a09567 Mon Sep 17 00:00:00 2001 From: Ruben Pollan Date: Thu, 21 Jun 2018 16:53:36 +0200 Subject: [bug] clean up vpn args for windows --- bitmask_go/vpn.go | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'bitmask_go/vpn.go') diff --git a/bitmask_go/vpn.go b/bitmask_go/vpn.go index 2a0862b..44fa768 100644 --- a/bitmask_go/vpn.go +++ b/bitmask_go/vpn.go @@ -36,21 +36,30 @@ func (b *Bitmask) StartVPN(provider string) error { return err } - arg := []string{"--nobind", "--verb", "1"} - if runtime.GOOS == "windows" { - arg = append(arg, "--dev", "tun", "--log", `C:\bitmask\openvp.log`) - } - - bonafideArgs, err := b.bonafide.getOpenvpnArgs() + arg, err := b.bonafide.getOpenvpnArgs() if err != nil { return err } - arg = append(arg, bonafideArgs...) for _, gw := range gateways { arg = append(arg, "--remote", gw.IPAddress, "443", "tcp4") } certPemPath := b.getCertPemPath() - arg = append(arg, "--client", "--tls-client", "--remote-cert-tls", "server", "--management-client", "--management", openvpnManagementAddr+" "+openvpnManagementPort, "--ca", b.getCaCertPath(), "--cert", certPemPath, "--key", certPemPath) + arg = append(arg, + "--nobind", + "--verb", "1", + "--dev", "tun", + "--client", + "--tls-client", + "--remote-cert-tls", "server", + "--script-security", "1", + "--management-client", + "--management", openvpnManagementAddr, openvpnManagementPort, + "--ca", b.getCaCertPath(), + "--cert", certPemPath, + "--key", certPemPath) + if runtime.GOOS == "windows" { + arg = append(arg, "--log", `C:\bitmask\openvp.log`) + } return b.launch.openvpnStart(arg...) } -- cgit v1.2.3