package vyprvpn import ( "strconv" "github.com/qdm12/gluetun/internal/configuration" "github.com/qdm12/gluetun/internal/constants" "github.com/qdm12/gluetun/internal/models" "github.com/qdm12/gluetun/internal/provider/utils" ) func (v *Vyprvpn) BuildConf(connection models.Connection, settings configuration.OpenVPN) (lines []string) { if settings.Cipher == "" { settings.Cipher = constants.AES256cbc } if settings.Auth == "" { settings.Auth = constants.SHA256 } lines = []string{ "client", "dev tun", "nobind", "persist-key", "remote-cert-tls server", "ping 10", "ping-exit 60", "ping-timer-rem", "tls-exit", // Vyprvpn specific "comp-lzo", // "verify-x509-name lu1.vyprvpn.com name", "tls-cipher TLS-ECDHE-RSA-WITH-AES-256-GCM-SHA384:TLS-DHE-RSA-WITH-AES-256-CBC-SHA256:TLS-DHE-RSA-WITH-AES-256-CBC-SHA", //nolint:lll // Added constant values "auth-nocache", "mute-replay-warnings", "pull-filter ignore \"auth-token\"", // prevent auth failed loops "auth-retry nointeract", "suppress-timestamps", // Modified variables "verb " + strconv.Itoa(settings.Verbosity), "auth-user-pass " + constants.OpenVPNAuthConf, connection.OpenVPNProtoLine(), connection.OpenVPNRemoteLine(), "auth " + settings.Auth, } lines = append(lines, utils.CipherLines(settings.Cipher, settings.Version)...) if !settings.Root { lines = append(lines, "user "+settings.ProcUser) } if settings.MSSFix > 0 { lines = append(lines, "mssfix "+strconv.Itoa(int(settings.MSSFix))) } lines = append(lines, utils.WrapOpenvpnCA( constants.VyprvpnCertificate)...) lines = append(lines, "") return lines }