Skip to content

chore(dev): serve the API over HTTPS on :5080#23

Merged
hoangsnowy merged 1 commit into
mainfrom
feat/api-https
May 30, 2026
Merged

chore(dev): serve the API over HTTPS on :5080#23
hoangsnowy merged 1 commit into
mainfrom
feat/api-https

Conversation

@hoangsnowy
Copy link
Copy Markdown
Owner

Summary

Makes the local-dev scheme uniform. Web went HTTPS in PR #20 (:5180); the API still served http://localhost:5080, so the Aspire dashboard showed mixed http/https. This flips the API to HTTPS too.

  • src/AgentOs.Api/Properties/launchSettings.json — launch profile httphttps, applicationUrl https://localhost:5080. Aspire reads the profile, so the api resource now exposes HTTPS and the dashboard link is https://localhost:5080/scalar/v1. Same ASP.NET dev cert as Web.
  • Docs (README.md, docs/SETUP.md, CLAUDE.md) — Scalar / health / openapi / curl URLs → https.
  • Code defaults pointing at the local API → https so they aren't broken-by-default against an https-only API: RemoteAgent REMOTE_AGENT_HUB default + HttpPipelineClient Api:BaseUrl fallback. Both stay env-overridable.

Why Keycloak (:8080) and MailHog (:8025) stay HTTP

Deliberate, not an oversight:

  • Keycloak: serving KC over HTTPS on localhost means a self-signed cert in the container. The browser can click through a warning, but the backend OIDC metadata fetch (/.well-known/openid-configuration, server-to-server from API + Web) uses HttpClient, which rejects the untrusted cert — auth fails at startup. No security benefit on localhost. KC over HTTP for local dev is the standard setup; prod/Azure terminates TLS at the ingress (sslRequired: external already set).
  • MailHog: dev SMTP catcher, no native TLS.

A reverse-proxy / KC_HTTPS_* + trust-store path exists if KC-on-HTTPS is ever wanted locally — separate, larger change.

Test plan

  • dotnet build AgentOs.slnx -c Release clean
  • dotnet run --project infra/AgentOs.AppHost → dashboard shows api as https://localhost:5080/scalar/v1, Scalar loads
  • dotnet dev-certs https --trust (shared with Web from PR chore: local dev HTTPS on :5180 + major dep bumps #20)

🤖 Generated with Claude Code

The Aspire dashboard mixed schemes — Web was HTTPS (:5180, PR #20) while
the API still showed http://localhost:5080. Flip the API to HTTPS too so
every .NET app endpoint in the AppHost is HTTPS and the documented links
match.

- src/AgentOs.Api/Properties/launchSettings.json: rename the launch
  profile http -> https, applicationUrl https://localhost:5080. Aspire
  reads the profile, so the api resource now exposes an HTTPS endpoint
  and the dashboard link is https://localhost:5080/scalar/v1. Uses the
  same ASP.NET dev cert as Web (dotnet dev-certs https --trust).
- Docs (README, docs/SETUP.md, CLAUDE.md): update the Scalar / health /
  openapi / curl example URLs to https.
- Code defaults that point at the local API follow it to https so they
  aren't broken-by-default against an https-only API:
  RemoteAgent REMOTE_AGENT_HUB default and the HttpPipelineClient
  Api:BaseUrl fallback. Both remain environment-overridable.

Keycloak (:8080) and MailHog (:8025) intentionally stay HTTP — see the
PR description. On localhost, putting KC behind a self-signed HTTPS cert
breaks the backend OIDC metadata fetch (HttpClient rejects the untrusted
cert) for zero security benefit; MailHog has no native TLS.

Build clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@hoangsnowy hoangsnowy merged commit 0e47468 into main May 30, 2026
1 check passed
@hoangsnowy hoangsnowy deleted the feat/api-https branch May 30, 2026 08:04
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.

1 participant