Feature: OPENVPN_VERSION which can be 2.4 or 2.5

This commit is contained in:
Quentin McGaw (desktop)
2021-05-31 18:54:36 +00:00
parent 7002bf8e34
commit b829490aac
12 changed files with 71 additions and 23 deletions

View File

@@ -1,10 +1,12 @@
package utils
import "strings"
import (
"github.com/qdm12/gluetun/internal/constants"
)
func CipherLines(cipher, version string) (lines []string) {
switch {
case strings.HasPrefix(version, "2.4"):
switch version {
case constants.Openvpn24:
return []string{"cipher " + cipher}
default: // 2.5 and above
return []string{

View File

@@ -18,12 +18,12 @@ func Test_CipherLines(t *testing.T) {
"data-ciphers AES",
},
},
"2.4.5": {
version: "2.4.5",
"2.4": {
version: "2.4",
lines: []string{"cipher AES"},
},
"2.5.3": {
version: "2.5.3",
"2.5": {
version: "2.5",
lines: []string{
"data-ciphers-fallback AES",
"data-ciphers AES",