Skip to contentSkip to conversation

about client-cert-not-required

Openvpn-devel Jan Just Keijser 4 participants 6 messages Jun 22, 2015 – Jun 24, 2015

lore
Share & tools
lore
#0 lore raw

hi all,

just found out that when you use 'client-cert-not-required' that the client certificate is not checked at all, even if one is presented. I'm not sure if that's by design but I think it would be handy to check the client certificate if presented by the client. This allows an admin to set up a server with multiple levels of access
- username+password only
- certificate only
- certificate + username for extra security

Right now , two separate instances of OpenVPN are needed for this. Patching this in for the OpenSSL version is trivial. If you set up the verify callback to use SSL_VERIFY_PEER (instead of SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT) it *will* check the client side cert, if present, but it will not fail if not present. I can submit a patch for this anytime (tested it already), if people think this is the way forward. Also note that if you present an invalid certificate (wrong CA etc) the connection is rejected by the OpenSSL lib.

However, for the polarssl (excuse me, mbedtls) build of OpenVPN this is not so trivial: there is a call to make the verification option, but the docs for the function ssl_set_authmode state:

Note
On client, SSL_VERIFY_REQUIRED is the recommended mode. With
SSL_VERIFY_OPTIONAL, the user needs to call ssl_get_verify_result() at the right time(s), which may not be obvious, while REQUIRED always perform the verification as soon as possible. For example, REQUIRED was protecting against the "triple handshake" attack even before it was found.

and indeed, you can set SSL_VERIFY_OPTIONAL but then there is *NO* certificate check at all unless you call get_verify_result at some point - and the problem is, I have no clue which point that would be....

Thus, this mail boils down to two linked questions

1) do we think it's valuable to add something like this (currently NO cert checks are done when 'client-cert-not-required' is used) ?

2) how do we implement this in mbedtls ?

thx,

JJK

#1 lore raw
Quoted 2 lines · Jan Just Keijser

1) do we think it's valuable to add something like this (currently NO cert checks are done when 'client-cert-not-required' is used) ?

sounds like what you really want is for this to be renamed "--verify-client-cert (none|optional|required)" - with the default still being "required" of course - sort of like Apache's SSLVerifyClient

Signature · 6 lines
Cheers

Jason Haar
Corporate Information Security Manager, Trimble Navigation Ltd.
Phone: +1 408 481 8171
PGP Fingerprint: 7A2E 0407 C9A6 CAF6 2B9F 8422 C063 5EBB FE1D 66D1
#2 lore raw

Hi,

Quoted 8 lines · Jason Haar
Quoted 2 lines · Jan Just Keijser

1) do we think it's valuable to add something like this (currently NO cert checks are done when 'client-cert-not-required' is used) ?

sounds like what you really want is for this to be renamed "--verify-client-cert (none|optional|required)" - with the default still being "required" of course - sort of like Apache's SSLVerifyClient

Excellent suggestion - if I go ahead with the patch (pending on approval by others on this list) then I'll implement that as well.

JJK

#3 lore raw
In reply to Jason Haar

Hi,

Quoted 8 lines · Jason Haar
Quoted 2 lines · Jan Just Keijser

1) do we think it's valuable to add something like this (currently NO cert checks are done when 'client-cert-not-required' is used) ?

sounds like what you really want is for this to be renamed "--verify-client-cert (none|optional|required)" - with the default still being "required" of course - sort of like Apache's SSLVerifyClient

This makes sense to me. I agree that the current client-cert-not-required behaviour is error-prone. But I am reluctant to break setups that rely on this behaviour by changing client-cert-not-required. Jason's proposal gives us a nice way to deal with this:

In 2.3:
* Add soon-to-be-deprecated message to --client-cert-not-required man
page entry.

In 2.4:
* add --verify-client-cert (none|optional|required)
* add a clear deprecation message when client-cert-not-required is used

In 2.5+:
* Only support --verify-client-cert (none|optional|required)

Jan Just, if you could to the OpenSSL part, that would be great. I can do the polarssl/mbedtls equivalent if needed.

-Steffan

#4 lore raw

Hi,

Quoted 7 lines · Steffan Karger

In 2.3:
* Add soon-to-be-deprecated message to --client-cert-not-required man
page entry.

In 2.4:
* add --verify-client-cert (none|optional|required)
* add a clear deprecation message when client-cert-not-required is used

Sounds like a good plan to me.

As far as the feature itself is concerned, I'm not voicing an opinion (as I've never seen a deployment without client certs, so don't understand the implications)

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#5 lore raw
Quoted 3 lines · Gert Doering

As far as the feature itself is concerned, I'm not voicing an opinion (as I've never seen a deployment without client certs, so don't understand the implications)

I have - it's very useful in particular circumstances. But the few people like me who use it will have to move to the new format ;-)

The migration plan Steffan suggested sounds perfect

Signature · 6 lines
Cheers

Jason Haar
Corporate Information Security Manager, Trimble Navigation Ltd.
Phone: +1 408 481 8171
PGP Fingerprint: 7A2E 0407 C9A6 CAF6 2B9F 8422 C063 5EBB FE1D 66D1