sslrabbitmqssl-certificaterabbitmq-c

When/why would you need to use CACert in a TLS negotiation?


I am trying to understand the parameters used to configure TLS (specifically for rabbitmq but my question might be more general).

There are 4 main entities to consider:

These map to configuration settings including:

Why are there configuration settings for the CACert?

If the cert is signed by a CA then it already contains enough information to locate the CA (e.g. domain name). What is the CACert for and if or when is it sent during TLS negotiation? Is this just a convenience to save going off to the CA directly? You will still have to do this if the CACert does not match or point to one in your trust store.

The settings I'm referring to are "cacert" in the rabbitmq.config for the server and amqp_ssl_socket_set_cacert() in the C API (rabbitmq-c).

I would like to check that my understanding is correct (https://xkcd.com/386/)


Solution

  • First the CA private key here is irrelevant here since by definition it is private and hence you never have it, except if you do self signed certificates.

    The TLS handshake is:

    Depending on the client you may then have multiple configuration items: - the list of certificates to send as intermediate (either as a path to some directory or a single file with all of them in it) together with its own client certificate - the list of certificates you use (again a directory or a file) as fully trusted to verify the server certificate.

    Often, these two settins are only one.

    Now:

    If the cert is signed by a CA then it already contains enough information to locate the CA (e.g. domain name).

    Not sure to understand you, but in general no. First a certificate is not necessarily/only for a domain name it can be for other things. Then a certificate is typically signed by an intermediate, not directly by the CA. So I am not sure how you want to locate the CA?