# Several names on one port

A client tells the server which name it called (SNI) before the server shows its certificate. A CrushMFT port serves its own certificate and any others you give it, and each client gets the one whose names hold the name it asked for. Nobody types a table of names.

## Giving a port more certificates

In [Certificates](Prefs-Certificates.md), **Where used**, a port's row has **Add certificates for other names…**. Or, on a certificate, **Use it on…**, "as well, for the names it is for".

A client that asks for a name gets, in this order:

1. the certificate a port's table names for it (an override, below)
2. a certificate with exactly that name
3. a certificate with a wildcard that covers it: `*.example.com` covers `files.example.com`, not `example.com` and not `a.files.example.com`
4. the port's own certificate (a key store file's entry the port is set to, when it has several)

Two certificates for the same name with different keys (RSA and EC) are picked by what the client can use: older clients get RSA.

This works on HTTPS, FTPS and FTP with TLS (after AUTH TLS). HTTP/3 serves the port's own certificate.

## SAN: one certificate, several names

A certificate can hold many names (Subject Alternative Names). Its **Names** tab lists them, says whether each of the addresses people use is covered, and **Add names** makes a new one with more names: from Let's Encrypt, or a request for your certificate company.

## A file with several certificates

A JKS or PFX file with several keys is several certificates in the list. A port that uses the file picks among its entries by name too.

## The older ways

- A port's table of `host = certificate` pairs (IP / Servers, the port, TLS certificate, Advanced, SNI) overrides the names.
- Files named `HOST_file` beside the port's key store (the CrushFTP 11 way) still work where such files exist.
