OpenVPN Time sensitive keys

I want to make my OpenVPN server to be able to use time-sensitive keys so if a customer purchases 1-month key the key is only valid for a month and after that they are no longer able to connect to the server. Does anyone know how to do such a thing?

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.


For this there would be no particular OpenVPN functionality, so you would need to extend it beyond that. There are seemingly unlimited paths that you could choose for this, though few (if any) are going to already be laid out and ready without requiring you to develop a solution. One example of how this could be done is by using FreeRADIUS for OpenVPN authentication, and then having billing software which provisioned FreeRADIUS authentication.

In this example, you can see how to set OpenVPN to use FreeRADIUS here:

Then you can see here there is an old (perhaps in need of updating) plugin for WHMCS (popular billing software) to manage FreeRADIUS accounts:

As far as I know a clean end-to-end solution does not exist for this, but I hope that I have given you some ideas of how you can begin to proceed with such a task.