Skip to content

The tonic server process exit unexpected when the client get a wrong tls config #1897

Closed
@zier-one

Description

@zier-one

Bug Report

Version

v0.12.2 and master branch

Platform

Darwin XXX 23.6.0 Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:30 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6000 arm64

Description

First, let's try to run the server.rs and client.rs in examples/src/tls.
The server says:

Got a request from Some([::1]:59511) with info TlsConnectInfo { inner: TcpConnectInfo { local_addr: Some([::1]:50051), remote_addr: Some([::1]:59511) }, certs: None }

And the client says:

RESPONSE=Response { metadata: MetadataMap { headers: {"content-type": "application/grpc", "date": "Wed, 28 Aug 2024 09:15:40 GMT", "grpc-status": "0"} }, message: EchoResponse { message: "hello" }, extensions: Extensions }

Everything is OK for now.

Then, let's change one line in client.rs:

let tls = ClientTlsConfig::new()
.ca_certificate(ca)
.domain_name("example.com");

modify .domain_name("example.com"); to .domain_name("wrong.com"); in L16

And then, run the server.rs and client.rs again.

We can see the client says:

Error: tonic::transport::Error(Transport, ConnectError(Custom { kind: InvalidData, error: InvalidCertificate(NotValidForName) }))

It's OK, but the server process EXIT WITH NO ERROR. It confuses me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions