Skip to content

pingora-core fails to compile with the s2n TLS provider #818

@varunravi98

Description

@varunravi98

Describe the bug

pingora-core fails to compile when s2n is enabled for TLS due to a missing match arm in ALPN::to_wire_protocols().

Pingora info

Pingora version: 9ac75d0
Rust version: cargo 1.92.0 (344c4567c 2025-10-21)
Operating system version: Ubuntu 22.04, though I believe this issue is platform-agnostic

Steps to reproduce

Run cargo build --package pingora-core --features s2n

Expected results

I expected a successful build.

Observed results

The build failed with the following error:

   error[E0004]: non-exhaustive patterns: `&ALPN::Custom(_)` not covered
   --> pingora-core/src/protocols/tls/mod.rs:189:15
    |
189 |         match self {
    |               ^^^^ pattern `&ALPN::Custom(_)` not covered
    |
note: `ALPN` defined here
   --> pingora-core/src/protocols/tls/mod.rs:52:10
    |
 52 | pub enum ALPN {
    |          ^^^^
...
 61 |     Custom(CustomALPN),
    |     ------ not covered
    = note: the matched value is of type `&ALPN`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
    |
192 ~             ALPN::H2H1 => vec![b"h2".to_vec(), b"http/1.1".to_vec()],
193 ~             &ALPN::Custom(_) => todo!(),

Additional context

I believe that the error can be fixed simply by adding a value for ALPN::Custom(custom). In fact, I think simplying copying the match arm provided for ALPN::Custom in Rustls should also work for s2n. I'll link a PR with that fix shortly.

Given that this error renders pingora-core 0.7.0 unusable with s2n, I'd appreciate it if the fix could be released sooner rather than later. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions