Feat: add verify-x509-name to Windscribe Openvpn config (#529)

This commit is contained in:
Quentin McGaw
2021-07-28 07:18:08 -07:00
committed by GitHub
parent 7d4f5c8906
commit c777f8d97d
8 changed files with 381 additions and 47 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -128,7 +128,7 @@ func Test_versions(t *testing.T) {
"Windscribe": { "Windscribe": {
model: models.WindscribeServer{}, model: models.WindscribeServer{},
version: allServers.Windscribe.Version, version: allServers.Windscribe.Version,
digest: "0bd93da1", digest: "6f6c16d6",
}, },
} }
for name, testCase := range testCases { for name, testCase := range testCases {

View File

@@ -9,7 +9,9 @@ type OpenVPNConnection struct {
IP net.IP `json:"ip"` IP net.IP `json:"ip"`
Port uint16 `json:"port"` Port uint16 `json:"port"`
Protocol string `json:"protocol"` Protocol string `json:"protocol"`
Hostname string `json:"hostname"` // Privado for tls verification // Hostname is used for IPVanish, IVPN, Privado
// and Windscribe for TLS verification
Hostname string `json:"hostname"`
} }
func (o *OpenVPNConnection) Equal(other OpenVPNConnection) bool { func (o *OpenVPNConnection) Equal(other OpenVPNConnection) bool {

View File

@@ -152,5 +152,6 @@ type WindscribeServer struct {
Region string `json:"region"` Region string `json:"region"`
City string `json:"city"` City string `json:"city"`
Hostname string `json:"hostname"` Hostname string `json:"hostname"`
OvpnX509 string `json:"x509"`
IPs []net.IP `json:"ips"` IPs []net.IP `json:"ips"`
} }

View File

@@ -32,6 +32,7 @@ func (w *Windscribe) GetOpenVPNConnection(selection configuration.ServerSelectio
IP: IP, IP: IP,
Port: port, Port: port,
Protocol: protocol, Protocol: protocol,
Hostname: server.OvpnX509,
} }
connections = append(connections, connection) connections = append(connections, connection)
} }

View File

@@ -50,6 +50,7 @@ func (w *Windscribe) BuildConf(connection models.OpenVPNConnection,
connection.ProtoLine(), connection.ProtoLine(),
connection.RemoteLine(), connection.RemoteLine(),
"auth " + settings.Auth, "auth " + settings.Auth,
"verify-x509-name " + connection.Hostname + " name",
} }
lines = append(lines, utils.CipherLines(settings.Cipher, settings.Version)...) lines = append(lines, utils.CipherLines(settings.Cipher, settings.Version)...)

View File

@@ -26,8 +26,9 @@ type regionData struct {
} }
type groupData struct { type groupData struct {
City string `json:"city"` City string `json:"city"`
Nodes []serverData `json:"nodes"` Nodes []serverData `json:"nodes"`
OvpnX509 string `json:"ovpn_x509"`
} }
type serverData struct { type serverData struct {

View File

@@ -25,6 +25,7 @@ func GetServers(ctx context.Context, client *http.Client, minServers int) (
region := regionData.Region region := regionData.Region
for _, group := range regionData.Groups { for _, group := range regionData.Groups {
city := group.City city := group.City
x5090Name := group.OvpnX509
for _, node := range group.Nodes { for _, node := range group.Nodes {
const maxIPsPerNode = 3 const maxIPsPerNode = 3
ips := make([]net.IP, 0, maxIPsPerNode) ips := make([]net.IP, 0, maxIPsPerNode)
@@ -41,6 +42,7 @@ func GetServers(ctx context.Context, client *http.Client, minServers int) (
Region: region, Region: region,
City: city, City: city,
Hostname: node.Hostname, Hostname: node.Hostname,
OvpnX509: x5090Name,
IPs: ips, IPs: ips,
} }
servers = append(servers, server) servers = append(servers, server)