Given a specific block cipher such as AES, CCM is a specific AEAD scheme: authenticated encryption with associated data, with IND-CCA3 security, loosely meaning it resists eavesdropping and forgery simultaneously.
Encrypt-then-MAC is a generic way to compose an AEAD scheme out of a cipher and a MAC. It always works, in the sense that if the cipher has the standard IND-CPA security expected of it, loosely meaning it resists eavesdropping, and the MAC has the standard UF-CMA security expected of it, loosely meaning it resists forgery, then the encrypt-then-MAC composition has the standard IND-CCA3 security expected of it.
MAC-then-encrypt is another generic way to compose an AEAD scheme out of a cipher and a MAC. But it doesn't always work: there exist IND-CPA ciphers and UF-CMA MACs whose MAC-then-encrypt composition is not IND-CCA3. And it has very sharp edges: some ciphers, such as AES in CBC mode, reject certain messages on decryption due to padding, but the MAC rejects them differently, and the difference reveals information about the plaintexts of messages. This led to the Lucky 13 attack on TLS.
However, while MAC-then-encrypt doesn't always work, it sometimes works, and in the specific case of AES-CCM, which is a MAC-then-encrypt composition of the cipher AES-CTR and a length-tagged variant of the MAC AES-CBC-MAC, it turns out to have IND-CCA3 security and fewer sharp edges. (Safety of randomly chosen nonces, and reuse of nonces, are left as a story for another day.)
Traditionally TLS used a generic MAC-then-encrypt composition for a cipher and a MAC negotiated independently between the server and the client. Eventually the TLS designers realized this was a mistake, and the IETF adopted two remedies for TLS 1.2:
- RFC 5246 ‘TLS 1.2’, §6.2.3.3 ‘AEAD Ciphers’: Let the server and client negotiate a specific AEAD scheme, such as AES-GCM or AES-CCM.
- RFC 7366 ‘Encrypt-then-MAC for TLS and DTLS’: Let the server and client negotiate cipher and MAC independently as before, and also let them negotiate the use of encrypt-then-MAC composition instead of MAC-then-encrypt composition.
In TLS 1.3, RFC 8446, all cipher suites are AEAD; there is no generic composition at the layer of the TLS protocol, making the protocol substantially simpler.