Feat: add verify-x509-name to Windscribe Openvpn config (#529)
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -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 {
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|||||||
@@ -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"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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)...)
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user