I am attempting to connect to a service using OpenVPN.
There are a number of configuration files (.OVPN
) that share a single certificate (ca.crt
); all are located in the same directory. Canada.ovpn, for example:
client
dev tun
proto udp
remote ca.#########.com 443
resolv-retry 5
nobind
fast-io
float
tun-mtu 1500
tun-mtu-extra 32
mssfix 1450
persist-key
persist-tun
ca ca.crt
auth-user-pass
comp-lzo
route-delay 5 30
script-security 3 system
ping-restart 0
mute-replay-warnings
verb 3
When I attempt to connect:
sudo openvpn --config ./configs/canada.ovpn --auth-user-pass ./credentials.txt
I get an error that reads:
Options error: --ca fails with 'ca.crt': No such file or directory Options error: Please correct these errors. Use --help for more information.
It seems that openvpn
is having difficultly with the relative path. I changed the relevant line to ca ./ca.crt
, but that resulted in the same error.
Configuration files that have an in-line certificate work as expected.
What is the correct way to use a relative path to a certificate in an .OVPN
file?
It appears that the referenced file does not exist in the current working directory.
Is your intention to reference a file that is also in the same directory as the config (
.ovpn
) file? If so, based on your command line, it does not appear that these files are actually in./
but rather inconfigs/
.As a better approach, I believe you may want to use the
--cd
option to haveopenvpn
change working directories before opening any files.