kylemanna / docker-openvpn

🔒 OpenVPN server in a Docker container complete with an EasyRSA PKI CA
https://hub.docker.com/r/kylemanna/openvpn/
MIT License
8.62k stars 2.37k forks source link

Server Certificate Expired - How to Renew? #731

Closed batesenergy closed 1 year ago

batesenergy commented 1 year ago

Our server certificate has expired and clients are unable to connect! How do we renew the server certificates? or extend its expiration?

This is for a production VPN so any quick help would be greatly appreciated!

nrukavkov commented 1 year ago

the same problem

nrukavkov commented 1 year ago

@batesenergy I removed previous certificate and create a new one with the same name. Here is a example https://github.com/angristan/openvpn-install/issues/1002#issuecomment-1229525488

batesenergy commented 1 year ago

Did this work for you?

Patrick Bates Open IoT Group 207.242.6313

On Sun, Jan 8, 2023, 1:45 PM Nikita Rukavkov @.***> wrote:

@batesenergy https://github.com/batesenergy I removed previous certificate and create a new one with the same name. Here is a example angristan/openvpn-install#1002 (comment) https://github.com/angristan/openvpn-install/issues/1002#issuecomment-1229525488

— Reply to this email directly, view it on GitHub https://github.com/kylemanna/docker-openvpn/issues/731#issuecomment-1374901105, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMCAJGPP6BGBXV3E34RYR2DWRMDOJANCNFSM6AAAAAATTSLLUA . You are receiving this because you were mentioned.Message ID: @.***>

nrukavkov commented 1 year ago

@batesenergy yes

batesenergy commented 1 year ago

For those who run into the same issue. Here are the changes we made to fix this issue:

server_cn= "Server Common Name" mv /etc/openvpn/pki/reqs/$server_cn.req /etc/openvpn/pki/reqs/$server_cn.req.backup mv /etc/openvpn/pki/private/$server_cn.key /etc/openvpn/pki/private/$server_cn.key.backup mv /etc/openvpn/pki/issued/$server_cn.crt /etc/openvpn/pki/issued/$server_cn.crt.backup cd /etc/openvpn easyrsa build-server-full $server_cn nopass

Then reboot the container to take effect.