Default a scheme-less s3.* endpoint to TLS #178

Merged
clawbot merged 1 commits from issue-158-s3-use-ssl-default into next 2026-09-22 11:11:34 +02:00
Collaborator

Fixes #158.

With the s3.* config form (no storage_url) and an s3.endpoint written without a scheme, an omitted use_ssl built an http:// endpoint, while config.example.yml documented use_ssl as defaulting to true. Over plain HTTP a network observer sees what the store operator sees (manifests, object names, sizes, the access key id) and can alter responses.

S3Config.UseSSL is now *bool: omitted (nil) resolves a scheme-less endpoint to https://; only an explicit use_ssl: false forces http://. An endpoint that already carries a scheme is still honored as written. This matches the s3:// URL form, which already defaults to TLS, and makes config.example.yml accurate without changing it.

The config init template previously listed use_ssl in the s3:// credentials block, where the key is never read (TLS for a URL is controlled by ?ssl=false). That line is dropped and replaced with a one-line note pointing at ?ssl=false.

A new test in internal/storage builds the storer from a legacy s3.* config with a scheme-less endpoint and checks the resolved endpoint scheme: use_ssl omitted yields https, explicit use_ssl: false yields http.

make check is green.

Model: opus-4-8

Fixes https://git.eeqj.de/sneak/vaultik/issues/158. With the `s3.*` config form (no `storage_url`) and an `s3.endpoint` written without a scheme, an omitted `use_ssl` built an `http://` endpoint, while `config.example.yml` documented `use_ssl` as defaulting to true. Over plain HTTP a network observer sees what the store operator sees (manifests, object names, sizes, the access key id) and can alter responses. `S3Config.UseSSL` is now `*bool`: omitted (nil) resolves a scheme-less endpoint to `https://`; only an explicit `use_ssl: false` forces `http://`. An endpoint that already carries a scheme is still honored as written. This matches the `s3://` URL form, which already defaults to TLS, and makes `config.example.yml` accurate without changing it. The `config init` template previously listed `use_ssl` in the `s3://` credentials block, where the key is never read (TLS for a URL is controlled by `?ssl=false`). That line is dropped and replaced with a one-line note pointing at `?ssl=false`. A new test in `internal/storage` builds the storer from a legacy `s3.*` config with a scheme-less endpoint and checks the resolved endpoint scheme: `use_ssl` omitted yields `https`, explicit `use_ssl: false` yields `http`. `make check` is green. Model: opus-4-8
clawbot added the needs-review label 2026-09-22 10:38:09 +02:00
clawbot self-assigned this 2026-09-22 10:38:09 +02:00
Author
Collaborator

PASS

Model: opus-4-8

PASS Model: opus-4-8
clawbot added needs-rebase and removed needs-review labels 2026-09-22 11:02:04 +02:00
clawbot added 1 commit 2026-09-22 11:04:36 +02:00
Default a scheme-less s3.* endpoint to TLS (closes #158)
check / check (pull_request) Successful in 2m35s
efdb5eeb2b
With the s3.* config form and an endpoint written without a scheme,
use_ssl being omitted built an http:// endpoint, while config.example.yml
documented use_ssl as defaulting to true. Over plain HTTP a network
observer sees manifests, object names, sizes and the access key id, and
can alter responses.

use_ssl is now *bool: omitted (nil) means the default, TLS; only an
explicit use_ssl: false forces plain HTTP. This matches the s3:// URL
form, which already defaults to TLS. The config init template dropped its
misleading use_ssl line from the s3:// block (that key is never read for
URLs; ?ssl=false controls TLS there) and points at ?ssl=false instead.

Model: opus-4-8
clawbot force-pushed issue-158-s3-use-ssl-default from fa4958c63e to efdb5eeb2b 2026-09-22 11:04:36 +02:00 Compare
Author
Collaborator

Rebased onto current next and force-pushed. The rebase applied cleanly with no conflicts: this PR's commit changes only source and test files, not TODO.md, so the anticipated TODO.md conflict did not arise and all entries remain intact. make check (tests + Docker lint + fmt-check) green.

Model: opus-4-8

Rebased onto current `next` and force-pushed. The rebase applied cleanly with no conflicts: this PR's commit changes only source and test files, not `TODO.md`, so the anticipated `TODO.md` conflict did not arise and all entries remain intact. `make check` (tests + Docker lint + fmt-check) green. Model: opus-4-8
clawbot merged commit d77663d039 into next 2026-09-22 11:11:34 +02:00
clawbot deleted branch issue-158-s3-use-ssl-default 2026-09-22 11:11:34 +02:00
Sign in to join this conversation.