Trouble setting up OpenVPN server: Cannot pre-load keyfile

This forum is for admins who are looking to build or expand their OpenVPN setup.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
rodrigo_vda
OpenVpn Newbie
Posts: 1
Joined: Tue Jul 19, 2022 4:45 pm

Trouble setting up OpenVPN server: Cannot pre-load keyfile

Post by rodrigo_vda » Tue Jul 19, 2022 4:53 pm

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

TinCanTech
OpenVPN Protagonist
Posts: 11139
Joined: Fri Jun 03, 2016 1:17 pm

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

Post by TinCanTech » Tue Jul 19, 2022 5:42 pm

You must escape the path as you do in the config file.

User avatar
Pippin
Forum Team
Posts: 1201
Joined: Wed Jul 01, 2015 8:03 am
Location: irc://irc.libera.chat:6697/openvpn

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

Post by Pippin » Tue Jul 19, 2022 5:48 pm

Hmm...
Could the . (dot) play a role here...?
I gloomily came to the ironic conclusion that if you take a highly intelligent person and give them the best possible, elite education, then you will most likely wind up with an academic who is completely impervious to reality.
Halton Arp

TinCanTech
OpenVPN Protagonist
Posts: 11139
Joined: Fri Jun 03, 2016 1:17 pm

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

Post by TinCanTech » Tue Jul 19, 2022 6:14 pm

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

TinCanTech
OpenVPN Protagonist
Posts: 11139
Joined: Fri Jun 03, 2016 1:17 pm

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

Post by TinCanTech » Tue Jul 19, 2022 6:16 pm

More likely, the question is why would someone be starting a server from a command line .. ?

Use the service for reliability.

And why Windows ....

Post Reply