OPENVPN_CIPHER variable (#100), refers to #94 and #59

This commit is contained in:
Quentin McGaw
2020-03-26 20:29:32 -04:00
committed by GitHub
parent d534f92432
commit 15a549be11
9 changed files with 37 additions and 11 deletions

View File

@@ -3,6 +3,7 @@ package params
import (
"fmt"
"net"
"strings"
libparams "github.com/qdm12/golibs/params"
"github.com/qdm12/private-internet-access-docker/internal/models"
@@ -63,3 +64,10 @@ func (p *paramsReader) GetTargetIP() (ip net.IP, err error) {
}
return ip, nil
}
// GetOpenVPNCipher obtains a custom cipher to use with OpenVPN
// from the environment variable OPENVPN_CIPHER
func (p *paramsReader) GetOpenVPNCipher() (cipher string, err error) {
cipher, err = p.envParams.GetEnv("OPENVPN_CIPHER")
return strings.ToLower(cipher), err
}