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": {
|
||||
model: models.WindscribeServer{},
|
||||
version: allServers.Windscribe.Version,
|
||||
digest: "0bd93da1",
|
||||
digest: "6f6c16d6",
|
||||
},
|
||||
}
|
||||
for name, testCase := range testCases {
|
||||
|
||||
@@ -9,7 +9,9 @@ type OpenVPNConnection struct {
|
||||
IP net.IP `json:"ip"`
|
||||
Port uint16 `json:"port"`
|
||||
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 {
|
||||
|
||||
@@ -152,5 +152,6 @@ type WindscribeServer struct {
|
||||
Region string `json:"region"`
|
||||
City string `json:"city"`
|
||||
Hostname string `json:"hostname"`
|
||||
OvpnX509 string `json:"x509"`
|
||||
IPs []net.IP `json:"ips"`
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ func (w *Windscribe) GetOpenVPNConnection(selection configuration.ServerSelectio
|
||||
IP: IP,
|
||||
Port: port,
|
||||
Protocol: protocol,
|
||||
Hostname: server.OvpnX509,
|
||||
}
|
||||
connections = append(connections, connection)
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ func (w *Windscribe) BuildConf(connection models.OpenVPNConnection,
|
||||
connection.ProtoLine(),
|
||||
connection.RemoteLine(),
|
||||
"auth " + settings.Auth,
|
||||
"verify-x509-name " + connection.Hostname + " name",
|
||||
}
|
||||
|
||||
lines = append(lines, utils.CipherLines(settings.Cipher, settings.Version)...)
|
||||
|
||||
@@ -26,8 +26,9 @@ type regionData struct {
|
||||
}
|
||||
|
||||
type groupData struct {
|
||||
City string `json:"city"`
|
||||
Nodes []serverData `json:"nodes"`
|
||||
City string `json:"city"`
|
||||
Nodes []serverData `json:"nodes"`
|
||||
OvpnX509 string `json:"ovpn_x509"`
|
||||
}
|
||||
|
||||
type serverData struct {
|
||||
|
||||
@@ -25,6 +25,7 @@ func GetServers(ctx context.Context, client *http.Client, minServers int) (
|
||||
region := regionData.Region
|
||||
for _, group := range regionData.Groups {
|
||||
city := group.City
|
||||
x5090Name := group.OvpnX509
|
||||
for _, node := range group.Nodes {
|
||||
const maxIPsPerNode = 3
|
||||
ips := make([]net.IP, 0, maxIPsPerNode)
|
||||
@@ -41,6 +42,7 @@ func GetServers(ctx context.Context, client *http.Client, minServers int) (
|
||||
Region: region,
|
||||
City: city,
|
||||
Hostname: node.Hostname,
|
||||
OvpnX509: x5090Name,
|
||||
IPs: ips,
|
||||
}
|
||||
servers = append(servers, server)
|
||||
|
||||
Reference in New Issue
Block a user