Skip to content

feat(tls): add mkcert-based TLS for HTTPS on port 8443#158

Open
bussyjd wants to merge 1 commit intointegration-okr-1from
feat/mkcert-tls
Open

feat(tls): add mkcert-based TLS for HTTPS on port 8443#158
bussyjd wants to merge 1 commit intointegration-okr-1from
feat/mkcert-tls

Conversation

@bussyjd
Copy link
Collaborator

@bussyjd bussyjd commented Feb 13, 2026

Summary

  • Add mkcert-based TLS certificate generation for *.obol.stack wildcard domain
  • New internal/tls package handles cert generation, path helpers, and K8s Secret creation
  • obol stack init generates trusted certs via mkcert; obol stack up creates the TLS Secret and patches the Traefik Gateway with a websecure HTTPS listener on port 8443
  • OpenClaw HTTPRoutes attach to both web (HTTP) and websecure (HTTPS) listeners
  • Dashboard URL auto-detects HTTPS when certs are present
  • Import gateway token from ~/.openclaw/openclaw.json during setup (fixes first-deploy validation)
  • Default model switched to gpt-oss:20b-cloud (Ollama cloud)

Context

OpenClaw's Control UI requires crypto.subtle (Web Crypto API) for device identity — browsers only expose this in secure contexts (HTTPS or localhost). Without TLS, http://<instance>.obol.stack:8080 forces fallback to allowInsecureAuth: true (token-only auth, no device pairing).

This PR enables https://<instance>.obol.stack:8443 so crypto.subtle is available and full device auth works. HTTP fallback on port 8080 remains functional.

Note on trust store: mkcert -install runs during obol stack init (interactive, can prompt for OS keychain). JAVA_HOME is stripped from the environment to avoid keytool errors on systems with broken Java keystores.

Closes #155

Test plan

  • go test ./... — all tests pass (TLS, stack helmfile patching, overlay generation)
  • obol stack init generates certs to <configDir>/tls/
  • obol stack up creates obol-stack-tls Secret in traefik namespace
  • curl https://obol.stack:8443/ — TLS 1.3, certificate verified, 200 OK
  • curl https://openclaw-default.obol.stack:8443/ — wildcard SAN match, 200 OK
  • curl http://obol.stack:8080/ — HTTP fallback still works, 200 OK
  • Inference waterfall: HTTPS → OpenClaw → Ollama cloud → response
  • Fresh install test on clean machine (verify mkcert -install prompts correctly)

Enable crypto.subtle in browsers by serving *.obol.stack over HTTPS.
This allows OpenClaw's Control UI to use Web Crypto API for device
identity (Ed25519 keypair) instead of falling back to token-only auth.

- New internal/tls package: cert generation, K8s Secret management
- obolup.sh: install mkcert v1.4.4 as optional dependency
- stack init: generate wildcard cert for *.obol.stack via mkcert
- stack up: create obol-stack-tls Secret, patch helmfile for websecure
  Gateway listener with HTTPS on port 8443
- openclaw: add websecure parentRef, HTTPS dashboard URL when certs exist
- Import gateway token from ~/.openclaw/openclaw.json on setup
- Default model switched to gpt-oss:20b-cloud (Ollama cloud)

HTTP fallback on port 8080 remains fully functional.
allowInsecureAuth kept for HTTP-only environments.

Closes #155
Base automatically changed from feat/wildcard-dns-resolver to integration-okr-1 February 13, 2026 14:49
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.

2 participants