> ## Documentation Index
> Fetch the complete documentation index at: https://midplane.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# TLS

> Midplane connects to every source over TLS. When its certificate is verified, when it is encrypted but not verified, and how to get it verified.

Midplane connects to every source over TLS, whatever the connection string
says, and refuses a database that doesn't offer it. A source's page says,
under **Connection**, whether the certificate verified:

| The page says | Meaning |
| - | - |
| **TLS verified** | The certificate chains to an authority Midplane trusts and names the database's host. |
| **Encrypted, not verified** | Nothing can read the traffic, but Midplane can't tell your server from an impostor. The page says why; **Sources** marks the source in orange. |

## How Midplane decides

The test tries a verified connection first. The certificate must name the
host in the connection string and chain to one of:

* the public authorities in Node.js's root store, such as Let's Encrypt
  (Neon and PlanetScale chain to them);
* Amazon RDS's global bundle (RDS and Aurora, every region) and Supabase
  Root 2021 CA, which Midplane carries;
* a CA certificate you pasted for the source.

If the certificate fails, Midplane connects encrypted but not verified,
unless the connection string asks for verification or the source has
verified before. Then the test fails
([the database certificate did not verify](https://midplane.ai/docs/connect/troubleshooting.md#the-database-certificate-did-not-verify)).

## What the connection string asks

| In the string | Midplane |
| - | - |
| Nothing, `disable`, `allow`, `prefer`, `require` (MySQL `DISABLED`, `PREFERRED`, `REQUIRED`, `ssl=true` or `false`) | Uses TLS, and verifies the certificate when it can. |
| Postgres `verify-ca` or `verify-full`, MySQL `VERIFY_CA` or `VERIFY_IDENTITY` | Connects only if the certificate verifies, host name included, even for `verify-ca`. |

MySQL's may be spelled `ssl-mode`, `sslmode` or `ssl_mode`. File paths
such as `sslrootcert`, `sslcert` and `sslkey` show as **Ignored**. Midplane
presents no client certificate, so a database that requires one refuses
it.

## Get it verified

| The page says its certificate | Do this |
| - | - |
| is signed by an authority Midplane doesn't know | Paste the CA's certificate. |
| is self-signed | Issue the server a certificate from a CA, and paste that CA. |
| doesn't name this host | Connect by a name the certificate carries, not an IP address or alias, or issue one for that name. |
| has expired or isn't valid yet | Renew it, check the server's clock, then **Test again**. |
| didn't verify | Check the certificate and its chain on the server. |

Paste the authority's certificate in PEM (`-----BEGIN CERTIFICATE-----`
to `-----END CERTIFICATE-----`), never a private key: in the connect form,
or for a source under **Credentials**, with its connection string, then
**Test and replace**.

## Through an SSH bastion

Midplane checks the certificate against the host in the connection string,
never the bastion. Write the database's host as its certificate names it
and as the bastion resolves it; a MySQL database named by an IP address
connects encrypted, not verified.

## When the certificate changes

A verified source keeps verifying while new certificates chain to an
authority Midplane trusts. If your host moves to another CA, paste the new
one under **Credentials**: until then the source stops answering.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.