mirror of
https://github.com/juanfont/headscale.git
synced 2026-01-11 20:00:28 +01:00
[Bug] Headscale attempts to use non-existent TLS certs when using OIDC behind a reverse proxy #890
Closed
opened 2025-12-29 02:25:29 +01:00 by adam
·
10 comments
No Branch/Tag Specified
main
update_flake_lock_action
gh-pages
kradalby/release-v0.27.2
dependabot/go_modules/golang.org/x/crypto-0.45.0
dependabot/go_modules/github.com/opencontainers/runc-1.3.3
copilot/investigate-headscale-issue-2788
copilot/investigate-visibility-issue-2788
copilot/investigate-issue-2833
copilot/debug-issue-2846
copilot/fix-issue-2847
dependabot/go_modules/github.com/go-viper/mapstructure/v2-2.4.0
dependabot/go_modules/github.com/docker/docker-28.3.3incompatible
kradalby/cli-experiement3
doc/0.26.1
doc/0.25.1
doc/0.25.0
doc/0.24.3
doc/0.24.2
doc/0.24.1
doc/0.24.0
kradalby/build-docker-on-pr
topic/docu-versioning
topic/docker-kos
juanfont/fix-crash-node-id
juanfont/better-disclaimer
update-contributors
topic/prettier
revert-1893-add-test-stage-to-docs
add-test-stage-to-docs
remove-node-check-interval
fix-empty-prefix
fix-ephemeral-reusable
bug_report-debuginfo
autogroups
logs-to-stderr
revert-1414-topic/fix_unix_socket
rename-machine-node
port-embedded-derp-tests-v2
port-derp-tests
duplicate-word-linter
update-tailscale-1.36
warn-against-apache
ko-fi-link
more-acl-tests
fix-typo-standalone
parallel-nolint
tparallel-fix
rerouting
ssh-changelog-docs
oidc-cleanup
web-auth-flow-tests
kradalby-gh-runner
fix-proto-lint
remove-funding-links
go-1.19
enable-1.30-in-tests
0.16.x
cosmetic-changes-integration
tmp-fix-integration-docker
fix-integration-docker
configurable-update-interval
show-nodes-online
hs2021
acl-syntax-fixes
ts2021-implementation
fix-spurious-updates
unstable-integration-tests
mandatory-stun
embedded-derp
prtemplate-fix
v0.28.0-beta.1
v0.27.2-rc.1
v0.27.1
v0.27.0
v0.27.0-beta.2
v0.27.0-beta.1
v0.26.1
v0.26.0
v0.26.0-beta.2
v0.26.0-beta.1
v0.25.1
v0.25.0
v0.25.0-beta.2
v0.24.3
v0.25.0-beta.1
v0.24.2
v0.24.1
v0.24.0
v0.24.0-beta.2
v0.24.0-beta.1
v0.23.0
v0.23.0-rc.1
v0.23.0-beta.5
v0.23.0-beta.4
v0.23.0-beta3
v0.23.0-beta2
v0.23.0-beta1
v0.23.0-alpha12
v0.23.0-alpha11
v0.23.0-alpha10
v0.23.0-alpha9
v0.23.0-alpha8
v0.23.0-alpha7
v0.23.0-alpha6
v0.23.0-alpha5
v0.23.0-alpha4
v0.23.0-alpha4-docker-ko-test9
v0.23.0-alpha4-docker-ko-test8
v0.23.0-alpha4-docker-ko-test7
v0.23.0-alpha4-docker-ko-test6
v0.23.0-alpha4-docker-ko-test5
v0.23.0-alpha-docker-release-test-debug2
v0.23.0-alpha-docker-release-test-debug
v0.23.0-alpha4-docker-ko-test4
v0.23.0-alpha4-docker-ko-test3
v0.23.0-alpha4-docker-ko-test2
v0.23.0-alpha4-docker-ko-test
v0.23.0-alpha3
v0.23.0-alpha2
v0.23.0-alpha1
v0.22.3
v0.22.2
v0.23.0-alpha-docker-release-test
v0.22.1
v0.22.0
v0.22.0-alpha3
v0.22.0-alpha2
v0.22.0-alpha1
v0.22.0-nfpmtest
v0.21.0
v0.20.0
v0.19.0
v0.19.0-beta2
v0.19.0-beta1
v0.18.0
v0.18.0-beta4
v0.18.0-beta3
v0.18.0-beta2
v0.18.0-beta1
v0.17.1
v0.17.0
v0.17.0-beta5
v0.17.0-beta4
v0.17.0-beta3
v0.17.0-beta2
v0.17.0-beta1
v0.17.0-alpha4
v0.17.0-alpha3
v0.17.0-alpha2
v0.17.0-alpha1
v0.16.4
v0.16.3
v0.16.2
v0.16.1
v0.16.0
v0.16.0-beta7
v0.16.0-beta6
v0.16.0-beta5
v0.16.0-beta4
v0.16.0-beta3
v0.16.0-beta2
v0.16.0-beta1
v0.15.0
v0.15.0-beta6
v0.15.0-beta5
v0.15.0-beta4
v0.15.0-beta3
v0.15.0-beta2
v0.15.0-beta1
v0.14.0
v0.14.0-beta2
v0.14.0-beta1
v0.13.0
v0.13.0-beta3
v0.13.0-beta2
v0.13.0-beta1
upstream/v0.12.4
v0.12.4
v0.12.3
v0.12.2
v0.12.2-beta1
v0.12.1
v0.12.0-beta2
v0.12.0-beta1
v0.11.0
v0.10.8
v0.10.7
v0.10.6
v0.10.5
v0.10.4
v0.10.3
v0.10.2
v0.10.1
v0.10.0
v0.9.3
v0.9.2
v0.9.1
v0.9.0
v0.8.1
v0.8.0
v0.7.1
v0.7.0
v0.6.1
v0.6.0
v0.5.2
v0.5.1
v0.5.0
v0.4.0
v0.3.6
v0.3.5
v0.3.4
v0.3.3
v0.3.2
v0.3.1
v0.3.0
v0.2.2
v0.2.1
v0.2.0
v0.1.1
v0.1.0
Labels
Clear labels
CLI
DERP
DNS
Nix
OIDC
SSH
bug
database
documentation
duplicate
enhancement
faq
good first issue
grants
help wanted
might-come
needs design doc
needs investigation
no-stale-bot
out of scope
performance
policy 📝
pull-request
question
regression
routes
stale
tags
tailscale-feature-gap
well described ❤️
wontfix
Mirrored from GitHub Pull Request
No Label
bug
Milestone
No items
No Milestone
Projects
Clear projects
No project
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: starred/headscale#890
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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?
Originally created by @vguttmann on GitHub (Dec 18, 2024).
Is this a support request?
Is there an existing issue for this?
Current Behavior
Context: in our deployment, a central proxy handles everything HTTPS, so the proxy talks HTTP to Headscale, however, the server URL is still https, since all incoming requests will be HTTPS.
When marking OIDC as mandatory, headscale attempts to read a non-existent certificate in /etc/let's encrypt/live/headscale/cert.pem
That certificate did exist once, however, since we're handling HTTPS at the proxy level now, I deleted them from certbot.
Expected Behavior
Headscale works fine with OIDC required for startup enabled
Steps To Reproduce
Environment
Runtime environment
Anything else?
No response
@kradalby commented on GitHub (Dec 18, 2024):
0.22.3 is not supported anymore, can you test and see if it still apply with 0.23.0?
@vguttmann commented on GitHub (Dec 18, 2024):
Apologies, that issue was written somewhat from memory, I thought I had installed 0.22.3 because that's what I remember from my setup at home.
I actually set up 0.23.0, and never anything else in this case.
@vguttmann commented on GitHub (Dec 18, 2024):
I've attempted using http instead of https in the server URL as well, but the issue persists. Here's my (somewhat sanitized) config:
Our OIDC provider is a locally hosted instance of Keycloak, running behind exactly the same "the proxy handles TLS" style reverse proxy, in case that matters.
@mhahl commented on GitHub (Dec 18, 2024):
Hey @vguttmann I am running a similar setup as you, I cant seem to replicate this, however I have never used letsencrypt in the past.
Could try backing up and cleaning out
tls_letsencrypt_cache_dir?@vguttmann commented on GitHub (Dec 18, 2024):
That directory didn't even exist for me, maybe because I did not use Certbot as it's usually used - we just use certbot to request certificates for a subdomain of our choice from Sectigo without any actual verification (since they're just subdomains of our actual domain), using preshared keys, which obviously isn't really covered by the config file. Those requests, obviously, were done just as CLI commands
I just left those entries unchanged (except for cert and private key path), as they were supplied, and pointed headscale to /etc/letsencrypt/live/headscale/fullchain.pem and privkey.pem. Why it is now attempting to read cert.pem, even after I have used certbot to delete the certificate, and removed any mentions of them from the config file, is a mystery to me.
If you can work with Proxmox VM dumps, I could send one over to you after sanitizing the image a bit, obviously I do not want to leak our CA keys
@mhahl commented on GitHub (Dec 18, 2024):
If you could please attach the server logs when its starting up that might be helpful for anyone trying to help troubleshoot.
@vguttmann commented on GitHub (Dec 19, 2024):
Oh, right. Here's the output of
journalctl -u headscalefor a single start attempt@vguttmann commented on GitHub (Dec 19, 2024):
However, I'll also try setting up a new VM without ever touching certs, as your setup seems to work. I will keep the old, and as I said, if you want that machine for analysis, you can poke around in it
@vguttmann commented on GitHub (Dec 19, 2024):
Oh my god. I'm so stupid. I just assumed that journalctl gives me the most recent stuff first. THE DATE WAS RIGHT THERE. THE TIMESTAMPS WERE THERE.
This was complete stupidity on my part.
@kradalby commented on GitHub (Dec 19, 2024):
No worries, glad you figured it out!