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

0.12 reports invalid cert where 0.11 succeeded #1904

Closed
AArnott opened this issue Aug 30, 2024 · 4 comments
Closed

0.12 reports invalid cert where 0.11 succeeded #1904

AArnott opened this issue Aug 30, 2024 · 4 comments

Comments

@AArnott
Copy link

AArnott commented Aug 30, 2024

Bug Report

After upgrading tonic from 0.11.0 to 0.12.2, gRPC connections fail with InvalidCertificate(UnknownIssuer) for the exact same server endpoint.

Platform

Windows

Crates

tonic

Description

A very trivial repro, comprising just this:

use tonic::transport::{Channel, ClientTlsConfig, Uri};

#[tokio::main]
async fn main() -> Result<(), tonic::transport::Error> {
    let uri = "https://zec.rocks:443/".parse::<Uri>().unwrap();
    let tls = ClientTlsConfig::new().domain_name(uri.host().unwrap());
    let channel = Channel::builder(uri.clone())
        .tls_config(tls)?
        .connect()
        .await?;

    println!("Hello, world!");
    Ok(())
}

Succeeds when using tonic 0.11, but fails on 0.12.x.

I have the minimal repro ready to cargo run at this repo: https://github.com/aarnott/tonic_fail_repro (main branch works, broken branch doesn't). The only difference between them is the tonic version.

Expected (0.11 behavior)

Hello, world!

Actual (0.12.x behavior)

Error: tonic::transport::Error(Transport, ConnectError(Custom { kind: InvalidData, error: InvalidCertificate(UnknownIssuer) }))
error: process didn't exit successfully: `target\debug\gRpcTest.exe` (exit code: 1)
@AArnott
Copy link
Author

AArnott commented Aug 30, 2024

In the original project that led to this report, I was getting transport error instead of InvalidCertificate. But in both cases, just upgrading tonic as described above is the only thing that causes it to fail.

@str4d
Copy link

str4d commented Aug 30, 2024

I expect this is the same issue I ran into with this upgrade, specifically this entry in the 0.12.0 changelog:

BREAKING CHANGES

This was originally undocumented in the 0.12.0 release notes; the line was added later in #1781.

@str4d
Copy link

str4d commented Aug 30, 2024

@AArnott
Copy link
Author

AArnott commented Aug 30, 2024

Confirmed. Thank you!

@AArnott AArnott closed this as not planned Won't fix, can't repro, duplicate, stale Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants