Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic with match tls alpn xmpp-client #259

Open
tctlrd opened this issue Oct 25, 2024 · 2 comments
Open

Panic with match tls alpn xmpp-client #259

tctlrd opened this issue Oct 25, 2024 · 2 comments

Comments

@tctlrd
Copy link

tctlrd commented Oct 25, 2024

I have started to get a panic in caddy w/L4 from part of a config for an XMPP server that matches for alpn: xmpp-client.
It was working previously, but I updated caddy and now it seems to have broken or changed. I also tried with a json config with no yaml adapter and had the same issue.
The panic happens as soon as I visit a page that caddy is serving.
Is anyone else experiencing this?

I removed these lines and caddy is fine:
https://github.com/snikket-im/snikket-server/blob/f89e01402b9f5d5f63c9c54152531c3755587abd/docs/advanced/reverse_proxy.md?plain=1#L380-L389

routes: 
 - match: 
   - tls:      # match encrypted XMPP traffic 
       alpn: 
       - xmpp-client 
   handle: 
   - handler: proxy 
     upstreams: 
     - dial:   # and send to Snikket's encrypted XMPP port 
       - localhost:5223 

Here is the panic:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x159e52e]

goroutine 43 [running]:
github.com/mholt/caddy-l4/modules/l4tls.(*MatchALPN).Match(0xc000699d70, 0xc0007a4488)
	github.com/mholt/[email protected]/modules/l4tls/alpn_matcher.go:40 +0x2e
github.com/mholt/caddy-l4/modules/l4tls.(*MatchTLS).Match(0xc000745380, 0xc0003387e0)
	github.com/mholt/[email protected]/modules/l4tls/matcher.go:115 +0x2ea
github.com/mholt/caddy-l4/layer4.MatcherSet.Match({0xc0007398a0?, 0x596325?, 0xc00069ace8?}, 0xc0003387e0)
	github.com/mholt/[email protected]/layer4/matchers.go:53 +0xa3
github.com/mholt/caddy-l4/layer4.(*MatcherSets).AnyMatch(0xc0006336b0, 0xc0003387e0)
	github.com/mholt/[email protected]/layer4/matchers.go:88 +0x6f
github.com/mholt/caddy-l4/layer4.(*Server).Provision.RouteList.Compile.func1(0xc0003387e0)
	github.com/mholt/[email protected]/layer4/routes.go:156 +0x615
github.com/mholt/caddy-l4/layer4.HandlerFunc.Handle(0x1f83f58?, 0xc00069ace8?)
	github.com/mholt/[email protected]/layer4/handlers.go:61 +0x19
github.com/mholt/caddy-l4/layer4.(*Server).handle(0xc000338310, {0x1f83f58, 0xc00069ace8})
	github.com/mholt/[email protected]/layer4/server.go:171 +0x191
created by github.com/mholt/caddy-l4/layer4.(*Server).serve in goroutine 35
	github.com/mholt/[email protected]/layer4/server.go:89 +0x27c

snikket-im/snikket-server#237 (comment)

@vnxme
Copy link
Collaborator

vnxme commented Oct 25, 2024

Thanks for reporting. It may be caused by e491c44, I’ll check.

@vnxme
Copy link
Collaborator

vnxme commented Nov 12, 2024

@tctlrd Please try 3c6cc2c, your issue should have been resolved.

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

No branches or pull requests

2 participants