13

I know that for MTLS , both parties , Client and server exchange certificates. These certificates should be signed by a CA that both parties can trust in order to validate the certificate.

My question is , does MTLS also means in addition to verifying the certificate (if CA is trusted, leaf certificate is trusted) , either side (Server or client) can also do some additional checks like Hostname check or Whether the client connecting to the server is in the list of approved trusted entities?

Can anyone point me to the mTLS specification and what are the overheads in mTLS?

5 Answers 5

12

Besides what EJP has said about "MTLS" term, the TLS 1.2 specification doesn't have strict requirements regarding what information is to be checked and in which way.

It's up to the receiving party to decide if the presented certificate is to be trusted or not. This means that for example it's ok for the server to accept only certificates issued by the CA that belongs to the company that owns the server. This is how client-bank access systems often work - they accept only certificates issued by the bank and the common name of such certificate must correspond to the username provided in a web form.

Both parties are free to check any information in the certificate including direct comparison of public key hash (thus only particular keypairs will work no matter what is contained in other certificate properties).

0
8

The most up todate RFC regarding this subject is:

https://datatracker.ietf.org/doc/draft-ietf-oauth-mtls/ this is an extension to OAuth 2.0

The purpose of this document is to define a mechanism how TLS certificate is used in a context of replacing Client ID and Secret (aka, Client Credentials)

The standard establishes two mechanisms how a TLS Certificate is used as a client credential, and the associated token flows, and attributes.

The general summary of this is:

(a) Authorization Server: checks the certificate either according to PKI (signed by a valid root) The RFC does not define the options, but they are pretty self-explanatory and depend on the use case. But it can be (1) certificate is signed by a trusted root and, is not revoked, (2) individually recognize each certificate based on some logic.

(b) Resource server checks the token and client certificate (client credential, or CC), and used in the underlying TLS session. Please note that there are no validation checks concerning the certificate or its origin at TLS layer, all checks are performed at an Application layer. The resource server should, therefore, configure the TLS stack in a way that it does not verify whether the certificate presented by the client during the handshake is signed by a trusted CA certificate.

This mechanism becomes particularly interesting in some GDPR context, as it makes it impossible to share tokens between client and the server.

Overall a great feature for privacy, and improved security.

0

mTLS can be implemented by issuing all parties a CA certificate and adding these to all communicating parties, which is a sort of an access control list. Whoever has their CA certificate in your app's trust store is able to connect.

The trust system however is the same as with TLS in the case of a https connection - you can issue several certificates from the same CA and add the root CA certificate to the trust store of your app. It will trust all certificates issued from the same root. This is arguably easier to set up as you only have to add the app's own certificate and the CA root. However, if you want to revoke a certificate, it becomes a little more complicated.

I wrote a guide to generate certificates here:

0

First: Both server and client certificates have to be built with the same CA certificate and key

see : https://github.com/ysimonx/mtls-ssl-generator/blob/main/generate_certificates.sh

So you have to store the CA certificate on both sides :

  • On the server side : you can allow (this is optional) a client that provides client cert built with the same CA than its own certificate. (see rejectUnauthorized: true)
 https: {
    requestCert: true,
    rejectUnauthorized: true,
    key: fs.readFileSync("./certificates/server/serverKey.pem"),
    cert: fs.readFileSync("./certificates/server/serverCrt.pem") ,
    ca: [fs.readFileSync("./certificates/ca/caCrt.pem")]
   
  }

(exemple for a fastify nodejs https self-signed certificate server)

  • On the client side : you can allow (this is optional too) a server that provides (or not) the same CA certificate as the client knows
curl -k --cert ./certificates/client/clientCrt.pem --key ./certificates/client/clientKey.pem https://localhost:3000/

(parameter -k : do not verify the server certificate based upon a CA authority)

or

curl --cacert ./certificates/ca/caCrt.pem --cert ./certificates/client/clientCrt.pem --key ./certificates/client/clientKey.pem https://localhost:3000/

if you want the client to match the correct CA cert used by the server

-5

There is no 'MTLS Specification', for the very good reason that there is no such thing as 'MTLS'. You just made it up. The TLS specification, including mutual authentication, is to be found in RFC 2246 as amended.

The TLS APIs should make the peer certificate chain available to the application, so it can do any additional checking it likes.

'MTLS', insofar as it exists at all, refers to an Internet Draft for multiplexed TLS.

2
  • thanks. I would like to understand a bit more about additional checking. Can you give me some examples ?
    – user839917
    Oct 26, 2013 at 0:35
  • You keep asking questions about things you have defined yourself and asking what they mean. Suppose you give me some examples of 'additional checking'? You've given two in your question, but the one about trusted entities is already taken care of by the API.
    – user207421
    Oct 26, 2013 at 1:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.