Search code examples
authenticationcertificatetls1.2client-certificatesmutual-authentication

Mutual Authentication TLS


What is the use of mutual authentication in TLS without restricting the client cert?

Here is my understanding about client/mutual auth using TLS.

The idea is that both the server the client authenticate/verifies each other certs so,

1- The client verifies the server cert based on its CA trust store 
2- The server verifies the client cert based on its *CA trust store*

Now the key point to me is the second one, the server has to trust the client certificate by either saving it in the server trust store, or save the CA/ICA of the client cert, which should be private to the client, not via public CA, private CA to that client that the server wishes to trust.

Now [rfc5246][1] says the following

If the client has sent a certificate with signing ability, a digitally-signed
CertificateVerify message is sent to explicitly verify possession of
the private key in the certificate.

This won't achieve any authentication correct? for example, if I have a server that trusts any certificate signed by the trusted CAs around the world, then why bother at all with client authentication at all? [1]: https://www.rfc-editor.org/rfc/rfc5246


Solution

  • When the server gets the client cert (as part of the TLS protocol), the server does all the normal cert checks, including chaining up to a trusted root. For the server to trust a client cert issued by Foo CA, the server needs to have the Foo CA root already installed at the server.

    The corner stone of X.509 certs is root CA certs. A host should only trust certs issued by the CAs it trusts. So when an admin installs FooCA's roots, the admin is stating "I trust the certs issued by Foo and I trust that Foo did appropriate checks that the cert is valid and assigned to the correct entity."

    The server does not need to store the client's cert, there's no reason to. When the cert comes in as part of TLS, the server simply checks it. No persistence needed, and if anything fails, and that includes not having the Foo CA root cert installed, then the connection fails.

    The server DOES authenticate the client. A certificate binds a public key (in the cert) to an entity; for example [email protected]. When the client connects and the server asks for the client cert, the server will check that the name in the cert ([email protected]) matches the name of the user, but it will also get the client to encrypt some data using the private key associated with the public key in the cert, and if the server successfully decrypts the data, then the client ([email protected]) really is who they claim to be. Or, in the worst case, an imposter who got access to Frodo's private key :)

    Does that help?