OpenVPNAdapter icon indicating copy to clipboard operation
OpenVPNAdapter copied to clipboard

Providing serverAddress explicitly not working

Open swati-daffodilsw opened this issue 6 years ago • 2 comments

Hi @@ss-abramchuk,

As per your readme, I have provided serverAddress explicitly to the tunnelProtocol as my ovpn file does not contain remote address. But I am not able to connect to the vpn. Whereas If I provide remote address in ovpn file itself, I am able to connect.

Can you please guide me how can I achieve vpn connection by providing serverAddress explicitly?

Any help is appreciable.

Thanks

swati-daffodilsw avatar Dec 18 '18 07:12 swati-daffodilsw

Hi @swati-daffodilsw, OpenVPNConfiguration has a property named settings. It is a dictionary that represents OpenVPN profile as series of key/value pairs and can be used exclusively or in addition to file content. You can use it to provide remote address.

let configuration = OpenVPNConfiguration()
configuration.settings = ["remote": "X.X.X.X"]

ss-abramchuk avatar Dec 19 '18 07:12 ss-abramchuk

@ss-abramchuk Thanks for the information. It worked. There is one more case:

My ovpn file contains wrong remote address, so I have provided correct remote address explicitly as per the information you have provided. But I am not able to connect to the vpn, if ovpn file also contains remote address. Is it possible to connect to the vpn by providing remote address explicitly, even if ovpn file contains remote address?

swati-daffodilsw avatar Dec 19 '18 10:12 swati-daffodilsw