Page 1 of 1

Trouble setting up OpenVPN server: Cannot pre-load keyfile

Posted: Tue Jul 19, 2022 4:53 pm
by rodrigo_vda
Hi, I'm trying to set up an OpenVPN server in a windows machine, but I am having some trouble doing so.

When I launch

Code: Select all

.\openvpn.exe "C:\Program Files\OpenVPN\config\server.ovpn"
I get this error message

Code: Select all

2022-07-19 18:35:46 WARNING: --topology net30 support for server configs with IPv4 pools will be removed in a future release. Please migrate to --topology subnet as soon as possible.
2022-07-19 18:35:46 DEPRECATED OPTION: --cipher set to 'AES-256-CBC' but missing in --data-ciphers (AES-256-GCM:AES-128-GCM). Future OpenVPN version will ignore --cipher for cipher negotiations. Add 'AES-256-CBC' to --data-ciphers or change --cipher 'AES-256-CBC' to --data-ciphers-fallback 'AES-256-CBC' to silence this warning.
2022-07-19 18:35:46 Cannot pre-load keyfile (“C:\Users\username\.OpenVPN\Server-Keys\ta.key”)
2022-07-19 18:35:46 Exiting due to fatal error
I don't understand why I get this message, the file exists and is located there. he path is properly escaped in the .ovpn file:
tls-auth line in server config

tls-auth “C:\\Users\\username\\.OpenVPN\\Server-Keys\\ta.key” 0 # This file is secret

In fact just to make sure I copy-paste the path to the command line to open the exact same filepath and I can see the ta.key file opening

Code: Select all

#
# 2048 bit OpenVPN static key
#
-----BEGIN OpenVPN Static key V1-----
[CENSORED]
-----END OpenVPN Static key V1-----
I don't know how to further troubleshoot this issue so I created this account to seek help here, I hopw I'm posting this in the appropiate section

Re: Trouble setting up OpenVPN server: Cannot pre-load keyfile

Posted: Tue Jul 19, 2022 5:42 pm
by TinCanTech
You must escape the path as you do in the config file.

Re: Trouble setting up OpenVPN server: Cannot pre-load keyfile

Posted: Tue Jul 19, 2022 5:48 pm
by Pippin
Hmm...
Could the . (dot) play a role here...?

Re: Trouble setting up OpenVPN server: Cannot pre-load keyfile

Posted: Tue Jul 19, 2022 6:14 pm
by TinCanTech
Pippin wrote:
Tue Jul 19, 2022 5:48 pm
Could the . (dot) play a role here...?
Probably .. I did not notice that before.

Re: Trouble setting up OpenVPN server: Cannot pre-load keyfile

Posted: Tue Jul 19, 2022 6:16 pm
by TinCanTech
More likely, the question is why would someone be starting a server from a command line .. ?

Use the service for reliability.

And why Windows ....