Skip to content

Verify the FOG server's TLS certificate instead of curl -k - #196

Merged
mastacontrola merged 2 commits into
masterfrom
feat/tls-pin
Oct 27, 2026
Merged

mastacontrola merged 2 commits into
masterfrom
feat/tls-pin

Conversation

@mastacontrola

Copy link
Copy Markdown
Member

FOS called the FOG server with curl -k on every request (#102). All ten call sites now go through bin/fog.curl:

  • pinned: fogpin= on the kernel command line. The server key must hash to it (-k --pinnedpubkey). A mismatch is curl exit 90, and the call fails.
  • verified: no pin. The chain is checked against the CA bundle the init now carries (BR2_PACKAGE_CA_CERTIFICATES on all three arches).
  • insecure: no pin, and the chain does not verify. FOS warns once per boot, then uses -k as before.

The pin travels on the command line, not in a file injected into init.xz. ADR-0020 records why.

Server half, to land first: FOGProject/fogproject feat/fos-tls-pin (working-1.6) and feat/fos-tls-pin-rc (rc-1.6.0).

Verification

  • tests/checks/tls-trust.sh (new) runs the shipped fog.curl against real curl and a local HTTPS server. 14/14 pass. Each case failed when its defect was reintroduced.
  • tests/run-all.sh: 30 passed, 0 failed.
  • A local x64 build carries /bin/fog.curl and /etc/ssl/certs/ca-certificates.crt (150 certs). The compressed init grew by 272 KB.
  • Not booted on hardware or in the VirtualBox lab.

Closes #102

🤖 Generated with Claude Code

mastacontrola and others added 2 commits October 27, 2026 06:04
Every FOS call to the server passed curl -k, so FOS never checked who
answered for $web (fos#102). All ten call sites now go through
bin/fog.curl, which picks one of three modes:

- pinned: fogpin= on the kernel command line. The server's public key
  must hash to it (-k --pinnedpubkey); a mismatch is curl exit 90.
- verified: no pin. The chain is checked against the CA bundle the init
  now carries (BR2_PACKAGE_CA_CERTIFICATES on all three arches).
- insecure: no pin, and the chain does not verify. Warn once per boot,
  then -k, as before.

The pin travels on the command line, not in a file injected into
init.xz: iPXE delivers both over the same channel, and an injected pin
goes stale when the certificate rotates. ADR-0020 records the reasoning.

tests/checks/tls-trust.sh runs the shipped fog.curl against real curl
and a local HTTPS server; each case was made to fail by reintroducing
its defect. The six harnesses that stub curl now stage fog.curl too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The server half (FOGProject/fogproject feat/fos-tls-pin) sends fogpin=
on its own under https, so the warning names the cause rather than an
admin step that has no setting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mastacontrola
mastacontrola merged commit b60504d into master Oct 27, 2026
1 check passed
@mastacontrola
mastacontrola deleted the feat/tls-pin branch October 27, 2026 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

https without curl -k in FOG OS?

1 participant