There is many possibilies :
- You have a self-signed certificate
If it is the case, your server cert would contain only one :
--BEGIN CERTIFICATE--
blablabla
--END CERTIFICATE"
instead of 2 or 3. In this case, the command to do is :
openssl req -nodes -days 3650 -new -out cert.pem -keyout key.pem -x509
Wait for private key creation then enter informations. And you will have cert.pem as a new certificate and key.pem as your server key up to 10 years (you can change days, expiration is recommended to not exceed 3 years for VPN). Previous one should be deleted. If it does not work, you have an issue with your openssl conf. Don't forget to protect them :
chown root:root cert.pem
chmod 444 cert.pem
chattr +i cert.pem
chown root:root key.pem
chmod 400 key.pem
chattr +i key.pem
- You have a leaf certificate from an authorative CA
Ask to your authorative to create a new cert.
- You have a leaf certificate from your own CA
Create a new certificate from your interface. I have my website that does this if anyone is interested.
You need to change server configuration with this new file or replace old one. If your client (which is highly possible) has the certificate in their config, you need to change all client config files.