OpenVPN Protocol
OpenVPN is a widely-used VPN protocol that provides secure and reliable connections.
Adding OpenVPN protocol support
To start using it, set the Protocol field to the OpenVpn
value from the Core.Model.Enums.Protocol enum
when starting the VPN.
var sdk = new SDK();
// ...
var getLocationsRequest = new GetLocationsRequest
{
AccessToken = loginResponse.AccessToken,
Protocol = Core.Model.Enums.Protocol.OpenVpn,
};
var getLocationsResponse = await sdk.GetLocationsAsync(getLocationsRequest).ConfigureAwait(false);
var selectedLocation = getLocationsResponse.VpnCustomLocations.FirstOrDefault();
var getCredentialsRequest = new GetCredentialsRequest
{
AccessToken = loginResponse.AccessToken,
VpnNode = selectedLocation,
WithCertificate = true,
Protocol = Core.Model.Enums.Protocol.OpenVpn,
};
var getCredentialsResponse = await sdk.GetCredentialsAsync(getCredentialsRequest).ConfigureAwait(false);
// ...
When changing the VPN protocol, it's important to call the GetLocations
and GetCredentials
methods before invoking startVPN. This is necessary because by calling GetLocations
and GetCredentials
after changing the protocol and before starting the VPN, you ensure that your application has the necessary information (available nodes) and authentication details (credentials) to successfully establish a VPN connection using the desired protocol.
Last updated
Was this helpful?