How to allow (some) expired client certificates?
Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech
-
- OpenVpn Newbie
- Posts: 17
- Joined: Tue Jan 28, 2020 7:47 pm
How to allow (some) expired client certificates?
I would like to prepare for the case that client certificates get expired and wondered if there's any option/hook one can use to tell OpenVPN to accept client certificates even if they have been expired?
Looking at the reference manual, I only found things which could be checked alternatively or additionally and then mostly after OpenVPN itself validated certificates already. But I can't find anything to tell that OpenVPN should do its normal certificate validation but only in case a certificate has been expired simply still allow it or optionally ask me by using some script.
"–tls-verify cmd" runs only after all other tests have passed already, but in case of an expired certificate things fail. The same seems to be the case for "-management-client-auth". Something like "–verify-client-cert none|optional|require" sounds promising, but there simply doesn't seem to be the case I need. Using username+password wouldn't help my use case, because that would involve reconfiguring lots of clients, in which case I could simply change certificates as well. I need something which relies on certificates but gives me some additional influence.
So is that possible at all currently? From what I've read it sounds like the answer is no. Thanks!
Looking at the reference manual, I only found things which could be checked alternatively or additionally and then mostly after OpenVPN itself validated certificates already. But I can't find anything to tell that OpenVPN should do its normal certificate validation but only in case a certificate has been expired simply still allow it or optionally ask me by using some script.
"–tls-verify cmd" runs only after all other tests have passed already, but in case of an expired certificate things fail. The same seems to be the case for "-management-client-auth". Something like "–verify-client-cert none|optional|require" sounds promising, but there simply doesn't seem to be the case I need. Using username+password wouldn't help my use case, because that would involve reconfiguring lots of clients, in which case I could simply change certificates as well. I need something which relies on certificates but gives me some additional influence.
So is that possible at all currently? From what I've read it sounds like the answer is no. Thanks!
-
- OpenVPN Protagonist
- Posts: 11138
- Joined: Fri Jun 03, 2016 1:17 pm
Re: How to allow (some) expired client certificates?
See --verify-client-cert in the man.
-
- OpenVpn Newbie
- Posts: 17
- Joined: Tue Jan 28, 2020 7:47 pm
Re: How to allow (some) expired client certificates?
As can be read in my text, I did and it doesn't seem to provide what I'm looking for. How exactly does this option accept an expired certificate?
-
- OpenVPN Protagonist
- Posts: 11138
- Joined: Fri Jun 03, 2016 1:17 pm
Re: How to allow (some) expired client certificates?
I have never tried it myself, no need to. However, if it does not work that way then so be it.
Did you try issuing a new certificate to the client ?
Did you try issuing a new certificate to the client ?
-
- OpenVpn Newbie
- Posts: 17
- Joined: Tue Jan 28, 2020 7:47 pm
Re: How to allow (some) expired client certificates?
No, but I know that this is possible and am thinking of ways to avoid that for various reasons.
-
- OpenVPN Protagonist
- Posts: 11138
- Joined: Fri Jun 03, 2016 1:17 pm
Re: How to allow (some) expired client certificates?
I think you will find you are out of luck, unless you want to take a shot at changing the source code.
-
- OpenVpn Newbie
- Posts: 17
- Joined: Tue Jan 28, 2020 7:47 pm
Re: How to allow (some) expired client certificates?
I suspected the same. But have a look at the following error messages:
https://openvpn.net/community-resources ... n-methods/
So it seems that without certificates, everything else is always bound to at least username+password? Do you know where I can find docs about what exactly is possible with plugins when? Things like API-docs etc.?
Where does that "or plugin" belong to in your opinion? To me it reads like it's an additional 3rd option independent of all the others. But the only mention of "plugin" I found was in combination with "--auth-user-pass", like in the following docs:[...]ovpn-server[24352]: Options error: --verify-client-cert none|optional must be used with --management-client-auth, an --auth-user-pass-verify script, or plugin
https://openvpn.net/community-resources ... n-methods/
So it seems that without certificates, everything else is always bound to at least username+password? Do you know where I can find docs about what exactly is possible with plugins when? Things like API-docs etc.?
-
- OpenVPN Protagonist
- Posts: 11138
- Joined: Fri Jun 03, 2016 1:17 pm
Re: How to allow (some) expired client certificates?
The point you are missing is that, if you don't verify the client cert then openvpn expects you to verify by username/password. It's a minimum level of security and the manual makes it absolutely clear that your security is down to your user/pass verification.
I suggest you start with the Howto.
https://community.openvpn.net/openvpn/wiki/HOWTO
I suggest you start with the Howto.
https://community.openvpn.net/openvpn/wiki/HOWTO
-
- OpenVpn Newbie
- Posts: 17
- Joined: Tue Jan 28, 2020 7:47 pm
Re: How to allow (some) expired client certificates?
You should be more careful about what you tell people they didn't understand properly. :-/ Let's have a look at the docs:
none : a client certificate is not required. the client need to authenticate using username/password only.
"need" vs. "should", that's why I tested that specific setup and wondered what exactly the printed error message means.optional : a client may present a certificate but it is not required to do so. When using this directive, you should also use a –auth-user-pass-verify script to ensure that clients are authenticated using a certificate, a username and password, or possibly even both.
-
- OpenVPN Protagonist
- Posts: 11138
- Joined: Fri Jun 03, 2016 1:17 pm
Re: How to allow (some) expired client certificates?
tschoening wrote: ↑Wed Jan 29, 2020 6:48 pmYou should be more careful about what you tell people they didn't understand properly
tschoening wrote: ↑Wed Jan 29, 2020 5:53 pmOptions error: --verify-client-cert none|optional must be used with --management-client-auth, an --auth-user-pass-verify script, or plugin
tschoening wrote: ↑Wed Jan 29, 2020 6:48 pmneed" vs. "should", that's why I tested that specific setup and wondered what exactly the printed error message means.
TinCanTech wrote: ↑Wed Jan 29, 2020 6:06 pmThe point you are missing is that, if you don't verify the client cert then openvpn expects you to verify by username/password. It's a minimum level of security and the manual makes it absolutely clear that your security is down to your user/pass verification.
I suggest you start with the Howto.
https://community.openvpn.net/openvpn/wiki/HOWTO
Last edited by TinCanTech on Wed Jan 29, 2020 9:21 pm, edited 1 time in total.
-
- OpenVpn Newbie
- Posts: 17
- Joined: Tue Jan 28, 2020 7:47 pm
Re: How to allow (some) expired client certificates?
Why do you think I was asking for how exactly "or plugin" is meant, where it belongs to in the sentence and where I can find docs for that? Your bold "must" in combination with "or plugin" in theory could perfectly well mean that no combination of username+password is necessary IF one uses a plugin INSTEAD. The error message I quoted is simply NOT clear regarding that point and the docs I quoted are NOT clear regarding that point as well.
It would be of much more help if you would have been able to provide the docs I was requesting and unable to find myself instead of guessing what I might have understood or not.
It would be of much more help if you would have been able to provide the docs I was requesting and unable to find myself instead of guessing what I might have understood or not.
-
- OpenVPN Protagonist
- Posts: 11138
- Joined: Fri Jun 03, 2016 1:17 pm
Re: How to allow (some) expired client certificates?
One or the other ..tschoening wrote: ↑Wed Jan 29, 2020 7:52 pmWhy do you think I was asking for how exactly "or plugin" is meant
tschoening wrote: ↑Wed Jan 29, 2020 7:52 pmwhere it belongs to in the sentence and where I can find docs for that?
TinCanTech wrote: ↑Wed Jan 29, 2020 6:06 pmI suggest you start with the Howto.
https://community.openvpn.net/openvpn/wiki/HOWTO
Improvements to the documentation are always welcome.tschoening wrote: ↑Wed Jan 29, 2020 7:52 pmYour bold "must" in combination with "or plugin" in theory could perfectly well mean that no combination of username+password is necessary IF one uses a plugin INSTEAD. The error message I quoted is simply NOT clear regarding that point and the docs I quoted are NOT clear regarding that point as well.
It would be of much more help if you would have been able to provide the docs I was requesting and unable to find myself instead of guessing what I might have understood or not.
-
- OpenVpn Newbie
- Posts: 17
- Joined: Tue Jan 28, 2020 7:47 pm
Re: How to allow (some) expired client certificates?
Did you actually look at that HowTo? It contains the following sentence:TinCanTech wrote: ↑Wed Jan 29, 2020 9:24 pmtschoening wrote: ↑Wed Jan 29, 2020 7:52 pmwhere it belongs to in the sentence and where I can find docs for that?TinCanTech wrote: ↑Wed Jan 29, 2020 6:06 pmI suggest you start with the Howto.
https://community.openvpn.net/openvpn/wiki/HOWTO
The only plugin-related subdirectory I was able to find is "plugins" instead of "plugin" and that doesn't seem to contain any generic README explaining plugins in general, but only the specific ones already available:If you would like more information on developing your own plugins for use with OpenVPN, see the README files in the plugin subdirectory of the OpenVPN source distribution.
https://github.com/OpenVPN/openvpn/tree ... rc/plugins
And that's why I asked for additional details, as it's obvious that the existing username+password-plugin is not of much help answering my questions. I need to influence certificate validation itself, if at all.
So, do you know about general docs about plugins, available interfaces/hooks etc. to them or not?