You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Mailroom ACME mode should also serve plain HTTP on :80 #1953
When [acme] is configured, payjoin-mailroom binds a single listener (normally [::]:443) and serves only TLS. Certificates come from TLS-ALPN-01, so nothing ever listens on :80.
That shuts out clients that can't speak TLS. Bitcoin Core is the main one. These clients don't need TLS to use a mailroom safely, because OHTTP and the key bootstrap already protect the payload. Today an operator who wants to serve them has to drop ACME and put the plain build behind nginx with certbot, which is the setup ACME was meant to replace.
I realize payjoin-service still only listens on one port, when in reality it should probably listen on :443 with acme and :80 without it so that environments without TLS, e.g. Bitcoin Core, can still reach the directory while relying on bootstrap mechanisms other than TLS.
Hi, I'd like to work on this. Here's my plan. Does it sound right before I start?
Approach
Add an optional plain-HTTP listener to the ACME config (e.g. http_listener = "[::]:80" under [acme], also settable via PJ_ACME__HTTP_LISTENER).
In serve_acme, build Services / the Router once and serve the same app on both listeners:
TLS on listener through the existing ACME acceptor
plain HTTP on http_listener through tokio_listener with sleep_on_errors = true, as serve does
Run both servers in a single tokio::select! with shutdown_signal(), so SIGTERM stops both and flush_windows() still runs once.
Port 80 serves the full app with no redirect to HTTPS, since the whole point is to reach clients that can't follow one. ACME is unaffected because TLS-ALPN-01 stays on 443.
One shared app instance means one FilesDb and one sentinel tag. Mailboxes are shared across ports and self-loop detection still works.
Fail at startup if :80 can't be bound, instead of silently running TLS-only.
Also updating: config.example.toml, docker-compose.yml (80:80), the Nix module example, the mailroom README, and the CHANGELOG.
Tests
Factor the "serve app on TLS + optional plain listener" part so it can be tested with a self-signed cert like serve_manual_tls.
Check /health over both ports.
Post to a mailbox on one port and read it on the other.
Check that blocked IPs get 403 on :80.
Check that the config parses.
Manually, I can try Let's Encrypt staging and the Bitcoin Core feat/async-payjoin branch you mentioned.
Questions
Should ACME mode bind :80 by default, or only when http_listener is set?
Should the setting go under [acme] or at the top level, so manual-TLS setups could reuse it later?
AI disclosure: I used an AI assistant to help research the codebase and draft this comment. I've reviewed the plan and will write and understand the changes myself.
Activity
DanGould commentedon Oct 9, 2026
This could be tested with the actual Bitcoin Core integration @ValeraFinebits has been working on https://github.com/ValeraFinebits/bitcoin/tree/feat/async-payjoin
yahia008 commentedon Oct 9, 2026
Hi, I'd like to work on this. Here's my plan. Does it sound right before I start?
Approach
http_listener = "[::]:80"under[acme], also settable viaPJ_ACME__HTTP_LISTENER).serve_acme, buildServices/ theRouteronce and serve the same app on both listeners:listenerthrough the existing ACME acceptorhttp_listenerthroughtokio_listenerwithsleep_on_errors = true, asservedoestokio::select!withshutdown_signal(), so SIGTERM stops both andflush_windows()still runs once.Things I'll keep working
ConnectInfosocheck_geoipapplies on :80 too, keeping the Enforce mailroom access control on TLS serve paths #1941 fix intact.FilesDband one sentinel tag. Mailboxes are shared across ports and self-loop detection still works.Also updating:
config.example.toml,docker-compose.yml(80:80), the Nix module example, the mailroom README, and the CHANGELOG.Tests
serve_manual_tls./healthover both ports.feat/async-payjoinbranch you mentioned.Questions
:80by default, or only whenhttp_listeneris set?[acme]or at the top level, so manual-TLS setups could reuse it later?AI disclosure: I used an AI assistant to help research the codebase and draft this comment. I've reviewed the plan and will write and understand the changes myself.