Skip to content

native-tls 0.2.17: compile error - Protocol::Tlsv13 not covered in openssl backend #370

@Iwijn

Description

@Iwijn

Summary

native-tls v0.2.17 fails to compile with a non-exhaustive patterns error in src/imp/openssl.rs. The Protocol::Tlsv13 variant exists in the Protocol enum but is not handled in the openssl backend's match arms.

Error

error[E0004]: non-exhaustive patterns: `Some(Protocol::Tlsv13)` not covered
   --> native-tls-0.2.17/src/imp/openssl.rs:61:22
    |
 61 |     options |= match min {
    |                      ^^^ pattern `Some(Protocol::Tlsv13)` not covered

error[E0004]: non-exhaustive patterns: `Some(Protocol::Tlsv13)` not covered
   --> native-tls-0.2.17/src/imp/openssl.rs:75:22
    |
 75 |     options |= match max {
    |                      ^^^ pattern `Some(Protocol::Tlsv13)` not covered

Reproduction

cargo install cargo-tarpaulin   # or any crate that depends on native-tls ^0.2

Fails because cargo resolves native-tls to 0.2.17 (the latest), which has this bug.

Environment

  • native-tls: 0.2.17
  • rustc: 1.93.0-nightly (c23ed3ef2 2025-11-23)
  • OS: Linux (x86_64)

Workaround

Pin to native-tls ≤ 0.2.16, or use --locked when installing crates that depend on it (so their published Cargo.lock resolves to an older version).

Fix

The Protocol::Tlsv13 arm needs to be added to the min/max match blocks in src/imp/openssl.rs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions