Server TLS key changes on restart

Need help configuring your VPN? Just post here and you'll get that help.

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
vchav73
OpenVpn Newbie
Posts: 2
Joined: Thu Oct 12, 2017 10:26 pm

Server TLS key changes on restart

Post by vchav73 » Thu Oct 12, 2017 10:51 pm

I am running a OpenVPN 2.4.3 server inside a Docker container hosted on a Linux server using the server config shown below. I am able to connect clients no problem until I restart the server and I start getting "TLS Error: TLS handshake failed" in the client. I traced the problem back to the TLS key file being changed on the server. After experimentation I've determined that the TLS key change is triggered by the server restart.

I'm guessing I am missing something in my config which is causing this, but after a lot of googling, forum searching, and documentation reviews I haven't been able to figure out why. Anyone have suggestions?

Code: Select all

port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key
dh dh2048.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
client-config-dir ccd
ccd-exclusive
client-to-client
keepalive 10 120
tls-auth ta.key 0
comp-lzo
max-clients 10
user nobody
group nobody
persist-key
persist-tun
status /var/log/openvpn/openvpn-status.log
log /var/log/openvpn/openvpn.log
verb 4
explicit-exit-notify 1
cipher AES-256-CBC
auth SHA512
tls-version-min 1.2
tls-cipher TLS-ECDHE-RSA-WITH-AES-256-GCM-SHA384:TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384:TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384:TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384:TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA:TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA
plugin /usr/lib64/openvpn/plugins/openvpn-plugin-auth-pam.so "openvpn"
script-security 1
mode server
tls-server
reneg-sec 86400
writepid /var/run/openvpn-server/server.pid

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

Re: Server TLS key changes on restart

Post by TinCanTech » Fri Oct 13, 2017 9:18 pm


vchav73
OpenVpn Newbie
Posts: 2
Joined: Thu Oct 12, 2017 10:26 pm

Re: Server TLS key changes on restart

Post by vchav73 » Mon Oct 16, 2017 6:06 pm

Thanks for the reply.

This ended up being a problem with the entrypoint script in my Docker container, so it's unrelated to OpenVPN.

Post Reply