|
| 1 | +# CrateDB with SSL |
| 2 | + |
| 3 | +## About |
| 4 | + |
| 5 | +A service composition file (Docker or Podman) for running CrateDB |
| 6 | +with SSL enabled, using self-signed certificates. |
| 7 | + |
| 8 | +Accompanied are example client programs that connect to CrateDB/SSL |
| 9 | +using the canonical `?sslmode=require` connection option parameter, |
| 10 | +to use SSL, but turn off certificate validation. To turn it on, |
| 11 | +use `?sslmode=verify-ca` or `?sslmode=verify-full`. |
| 12 | + |
| 13 | +## Usage |
| 14 | + |
| 15 | +```shell |
| 16 | +docker compose up |
| 17 | +``` |
| 18 | + |
| 19 | +## Clients |
| 20 | + |
| 21 | +Client examples adjusted to disable certificate validation, allowing |
| 22 | +connections to the server with self-signed certificates. |
| 23 | + |
| 24 | +- [crash] » [client_crash.sh] |
| 25 | +- [DB API] » [client_dbapi.py] |
| 26 | +- [SQLAlchemy] » [client_sqlalchemy.py] |
| 27 | + |
| 28 | +## Tests |
| 29 | + |
| 30 | +```shell |
| 31 | +make test |
| 32 | +``` |
| 33 | + |
| 34 | +## Rationale |
| 35 | + |
| 36 | +When not disabling host name verification, clients will bail out with |
| 37 | +`SSLError`/`SSLCertVerificationError`: |
| 38 | +```text |
| 39 | +[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed |
| 40 | +certificate in certificate chain (_ssl.c:1010). |
| 41 | +``` |
| 42 | + |
| 43 | +## Backlog |
| 44 | + |
| 45 | +- Documentation is currently void of relevant ready-to-run examples |
| 46 | + - <https://cratedb.com/docs/guide/install/container/> |
| 47 | + - <https://cratedb.com/docs/guide/install/container/docker.html> |
| 48 | + - <https://cratedb.com/docs/crate/reference/en/latest/admin/ssl.html> |
| 49 | +- Possibly synchronize with `crate-pdo`, where this is derived from |
| 50 | + <https://github.com/crate/crate-pdo/tree/2.2.2/test/provisioning> |
| 51 | + |
| 52 | + |
| 53 | +[client_crash.sh]: ./client_crash.sh |
| 54 | +[client_dbapi.py]: ./client_dbapi.py |
| 55 | +[client_sqlalchemy.py]: ./client_sqlalchemy.py |
| 56 | +[crash]: https://cratedb.com/docs/crate/crash/ |
| 57 | +[DB API]: https://cratedb.com/docs/python/ |
| 58 | +[SQLAlchemy]: https://cratedb.com/docs/sqlalchemy-cratedb/ |
0 commit comments