Bug: Keycloak logs "Non-secure context detected" — cookies not secured behind Tailscale TLS #276
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ldraney/pal-e-platform#276
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type
Bug
Lineage
Discovered during Keycloak SMTP validation on 2026-04-08. Observed in pod logs.
Repo
forgejo_admin/pal-e-platformWhat Broke
Keycloak logs:
Non-secure context detected; cookies are not secured, and will not be available in cross-origin POST requests. This means Keycloak thinks it's running on HTTP, not HTTPS. Tailscale funnel terminates TLS before the request reaches the pod, so Keycloak sees plain HTTP internally.This can cause:
SecureflagRepro Steps
kubectl logs -n keycloak keycloak-7d796fc76c-prqxhNon-secure context detected; cookies are not securedExpected Behavior
Keycloak should be configured to trust the proxy (Tailscale funnel) and treat requests as HTTPS.
Environment
keycloak-7d796fc76c-prqxhAcceptance Criteria
KC_PROXY_HEADERS=xforwardedorKC_PROXY=edgeenv varSecureflagFile Targets
terraform/modules/keycloak/main.tf— add proxy env var to Keycloak Helm valuesRelated
pal-e-platform— Keycloak infrastructure