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

l4xmpp: Add support for matching XMPP connections, match TLS-ALPN #33

Merged
merged 4 commits into from
Nov 18, 2021

Conversation

Rijul-A
Copy link
Contributor

@Rijul-A Rijul-A commented Nov 5, 2021

  1. Add generic ALPN matcher, which is used to match xmpp-client for XMPP. Let me know if this is better suited elsewhere (like the main Caddy repository).
  2. Add XMPP matcher, which is similar to SSH matcher except it looks for the word jabber in the first 50 bytes.

Use case: Replacement for forwarding Snikket traffic over port 443 to relevant service; documented here using sslh

@mholt
Copy link
Owner

mholt commented Nov 8, 2021

Hi, thanks for this contribution! I am trying to tag a new release of Caddy but I hope to look at this in the next little while.

@francislavoie francislavoie added the enhancement New feature or request label Nov 17, 2021
@francislavoie francislavoie changed the title Add support for XMPP l4xmpp: Add support for matching XMPP connections, match TLS-ALPN Nov 17, 2021
Copy link
Owner

@mholt mholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this! The XMPP one is a good fit. I'm trying to decide whether the ALPN matcher is a better fit for Caddy's caddytls package directly so that other Caddy sites can use it, or if it should be exclusive to this module. Hmm hmm hmm. Most Caddy apps are using HTTP on top of TLS, since most Caddy users use it for its HTTP server. But then again, there could be value in handling a handshake one way based on ALPN versus another way, since that repo is where the TLS server lives.

Hmm...

I guess we can always start with it here and then move it if we need to (it's harder to go the other way around).

Please use go fmt to clean up the code, and ensure the copyright is intact. Thanks!

modules/l4tls/alpn_matcher.go Outdated Show resolved Hide resolved
@Rijul-A Rijul-A requested a review from mholt November 18, 2021 09:01
Copy link
Owner

@mholt mholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat, thank you so much for contributing this!

@Rijul-A
Copy link
Contributor Author

Rijul-A commented Oct 3, 2022

I just observed that the SSH matcher must be before the XMPP matcher for the handling to work correctly (matching appears to work fine in either order).

@mholt
Copy link
Owner

mholt commented Oct 4, 2022

@Rijul-A I wonder if that is due/related to #72.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants