Skip to content

Commit c777f8d

Browse files
authored
Feat: add verify-x509-name to Windscribe Openvpn config (#529)
1 parent 7d4f5c8 commit c777f8d

File tree

8 files changed

+381
-47
lines changed

8 files changed

+381
-47
lines changed

internal/constants/servers.json

Lines changed: 369 additions & 43 deletions
Large diffs are not rendered by default.

internal/constants/servers_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ func Test_versions(t *testing.T) {
128128
"Windscribe": {
129129
model: models.WindscribeServer{},
130130
version: allServers.Windscribe.Version,
131-
digest: "0bd93da1",
131+
digest: "6f6c16d6",
132132
},
133133
}
134134
for name, testCase := range testCases {

internal/models/openvpn.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ type OpenVPNConnection struct {
99
IP net.IP `json:"ip"`
1010
Port uint16 `json:"port"`
1111
Protocol string `json:"protocol"`
12-
Hostname string `json:"hostname"` // Privado for tls verification
12+
// Hostname is used for IPVanish, IVPN, Privado
13+
// and Windscribe for TLS verification
14+
Hostname string `json:"hostname"`
1315
}
1416

1517
func (o *OpenVPNConnection) Equal(other OpenVPNConnection) bool {

internal/models/server.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,5 +152,6 @@ type WindscribeServer struct {
152152
Region string `json:"region"`
153153
City string `json:"city"`
154154
Hostname string `json:"hostname"`
155+
OvpnX509 string `json:"x509"`
155156
IPs []net.IP `json:"ips"`
156157
}

internal/provider/windscribe/connection.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ func (w *Windscribe) GetOpenVPNConnection(selection configuration.ServerSelectio
3232
IP: IP,
3333
Port: port,
3434
Protocol: protocol,
35+
Hostname: server.OvpnX509,
3536
}
3637
connections = append(connections, connection)
3738
}

internal/provider/windscribe/openvpnconf.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ func (w *Windscribe) BuildConf(connection models.OpenVPNConnection,
5050
connection.ProtoLine(),
5151
connection.RemoteLine(),
5252
"auth " + settings.Auth,
53+
"verify-x509-name " + connection.Hostname + " name",
5354
}
5455

5556
lines = append(lines, utils.CipherLines(settings.Cipher, settings.Version)...)

internal/updater/providers/windscribe/api.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ type regionData struct {
2626
}
2727

2828
type groupData struct {
29-
City string `json:"city"`
30-
Nodes []serverData `json:"nodes"`
29+
City string `json:"city"`
30+
Nodes []serverData `json:"nodes"`
31+
OvpnX509 string `json:"ovpn_x509"`
3132
}
3233

3334
type serverData struct {

internal/updater/providers/windscribe/servers.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ func GetServers(ctx context.Context, client *http.Client, minServers int) (
2525
region := regionData.Region
2626
for _, group := range regionData.Groups {
2727
city := group.City
28+
x5090Name := group.OvpnX509
2829
for _, node := range group.Nodes {
2930
const maxIPsPerNode = 3
3031
ips := make([]net.IP, 0, maxIPsPerNode)
@@ -41,6 +42,7 @@ func GetServers(ctx context.Context, client *http.Client, minServers int) (
4142
Region: region,
4243
City: city,
4344
Hostname: node.Hostname,
45+
OvpnX509: x5090Name,
4446
IPs: ips,
4547
}
4648
servers = append(servers, server)

0 commit comments

Comments
 (0)