feat: require TLS to PostgreSQL, Valkey and S3

Storage servers accept only TLS 1.3 (pg_hba hostssl / hostnossl reject,
Valkey port 0, S3 gateway HTTPS only) with stand identities postgres,
valkey and s3. Clients trust only the stand CA from [client_tls] ca_file
and check the host name; no switch to disable verification. Processes
exit with code 2 without a CA or with an IP storage address. Temporary
stands, CI and bench/ run on TLS storages; make storage_tls_check adds
negative checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-18 21:17:49 +03:00
co-authored by Claude Opus 5.5
parent 25f5d981c0
commit 8bca5543fd
56 changed files with 2562 additions and 176 deletions
+8 -2
View File
@@ -188,7 +188,10 @@ async def run() -> int:
telemetry_enabled = telemetry.start_process_telemetry(
TELEMETRY_SERVICE_RELAY,
)
engine = create_engine(settings.database)
engine = create_engine(
settings.database,
ca_file=settings.client_tls.ca_file,
)
telemetry.instrument_engine(engine)
session_factory = create_session_factory(engine)
publisher = JobPublisher(settings.broker, namespace=namespace)
@@ -314,7 +317,10 @@ async def _serve(
async def run_replay(args: argparse.Namespace) -> int:
"""Реестр и replay: только PostgreSQL."""
stop = _install_stop()
engine = create_engine(settings.database)
engine = create_engine(
settings.database,
ca_file=settings.client_tls.ca_file,
)
session_factory = create_session_factory(engine)
service = AttachmentReplayService(
uow=SqlAlchemyUnitOfWork(