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?

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.

Submit an Answer
1 answer


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.