Optional mTLS rejects an untrusted client certificate; Harper's own listener would accept it as unauthorized
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 22/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- javascript, rust, typescript
- Domain
- networking, security
Research direction
Start in src/mtls.rs at SymphonyClientVerifier::verify_client_cert, which currently delegates to WebPkiClientVerifier, and at build_ssl_tlv in src/proxy_conn.rs, which writes the PP2 SSL verify field. Read server/serverHelpers/proxyProtocol.ts on the Harper side to confirm how verify maps to authorized. Done means an optional-mTLS route accepts an unverifiable chain, sets verify = 1 without forwarding the chain, and a required route still rejects it during the handshake. This is security-sensitive and needs maintainer review of the design.
Written by the indexing model from the issue text.
Description
Summary
On a route with optional client auth (mtls.requireClientCert: false), symphony rejects a client that presents a certificate it cannot verify, so the TLS handshake fails with unknown_ca. Harper's own TLS listener, with the same optional policy, accepts that client as unauthorized (rejectUnauthorized: Boolean(mtlsRequired), server/http.ts, server/threads/threadServer.js). Such a client could then fall back to basic or token auth. Behind symphony it cannot connect at all.
This matters now because host-manager publishes routes with optional mTLS taken from Harper's own socket metadata (HarperFast/host-manager#254). That PR describes the difference as one that "needs a symphony option".
Where
src/mtls.rs: SymphonyClientVerifier::verify_client_cert passes straight through to WebPkiClientVerifier. client_auth_mandatory() only controls whether a certificate is required, not what happens to one that fails verification.
Harper already handles the other half
server/serverHelpers/proxyProtocol.ts reads the PP2_TYPE_SSL verify field and sets authorized = certPresented && verify == 0. The receiving side needs no change. Today build_ssl_tlv (src/proxy_conn.rs) always writes verify = 0 when a chain is present, because rustls only completes the handshake when the cert verified.
Proposed fix
- When
require_certis false,verify_client_certaccepts the presented chain. rustls still runsverify_tls12_signature/verify_tls13_signature, which proves the client holds the certificate's private key. - After the handshake, verify the peer chain once against the route's CA bundle and record the result for the connection.
- When verification failed: set
PP2_CLIENT_CERT_CONN, writeverify = 1, and do not forward the chain. Harper then sees "a cert was presented but not verified" and never receives unverified certificate bytes it might read without checkingauthorized. - Required routes are unchanged: an unverifiable cert is still rejected during the handshake.
Related
- HarperFast/symphony#62: a route that fails to rebuild keeps its old client-certificate policy. Part 3 of #62 (a route with an empty CA bundle that can still be built) uses the same verifier path. With this change, an empty bundle on an optional route means "every client connects as unauthorized", and on a required route it means "reject every connection".
🤖 Generated with Claude Code
- Dominant language
- TypeScript
- Stars
- 1
- Forks
- 0
- Avg merge
- 11h 49m
- Merged PRs (30d)
- 12
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from HarperFast/symphony
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/symphony#91 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
HarperFast/symphony#89 ·
Maintainers usually reply within 1 day
-
Mixed-case SNI forwarded to an older peer during a rolling upgrade can reach its wildcard routeOpen
Difficulty 4/5 3-5 days Newbie friendliness 49/100
HarperFast/symphony#93 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
HarperFast/symphony#92 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
HarperFast/symphony#90 ·
Maintainers usually reply within 1 day
All issues in HarperFast/symphony
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
feature request needs triage
Difficulty 1/5 1-3 hours Newbie friendliness 69/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
solidjs/solid-docs#1716 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
thecodacus/pithagoras#380 ·
Maintainers usually reply within 1 day