# SQLx Test TLS Certificates
As of 2026-10-31, this directory no longer has pre-generated keys or certificates committed.
Instead, run the included Bash script to generate them (the `openssl` binary is required):
```bash
$ ./gen-certs.sh
```
After running the script, this directory contains the following files for testing TLS connections:
* `ca.crt`: Self-signed Certificate Authority for `client.crt`
* `client.crt`: Client certificate signed by `ca.crt`
* `keys/client.key`: Private key for `client.crt` (NOT ENCRYPTED)
* Includes `postgres` as the Common Name (CN) for authentication:
<https://www.postgresql.org/docs/current/auth-cert.html>
MySQL and MariaDB ignore this value.
* `server.crt`: Server certificate signed by `ca.crt`
* `keys/server.key`: Private key for `server.crt` (NOT ENCRYPTED)
* Includes `subjectAltName=sqlx.test` for hostname verification
* Use `sqlx.test` as the hostname when testing; the `.test` TLD cannot be registered,
so this certificate should never be valid for a real Internet domain name.
These certificates are **not** to be used outside of testing with SQLx.
They expire after 7 days by default, then they need to be regenerated.
RusTLS requires TLS certificates to be x509v3.
OpenSSL 3.2 and up create v3 certificates by default.
## MySQL 5.7 (RSA)
The default test certificates in this directory use Ed25519, which MySQL 5.7
cannot load.
However, MySQL 5.7 reached end-of life in October 2023.
RSA keys and certificates are no longer included in this directory,
nor are they generated by the script.