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

mTLS fails and server shutdown if client tries to connect without certificate #1945

Closed
marvinlanhenke opened this issue Sep 18, 2024 · 3 comments

Comments

@marvinlanhenke
Copy link

Bug Report

Version

0.12.2

╰─❯ cargo-tree tree | grep tonic
├── tonic v0.12.2
└── tonic-build v0.12.2

Platform

Linux 5.10.16.3-microsoft-standard-WSL2 #1 SMP Fri Apr 2 22:23:49 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Description

I ran the example server and tried to connect with grpcurl without any certificate at all. The server shutdown; thus not able to accept any new connections.
I enabled tracing and repeated the process.

grpcurl output:
Failed to dial target host: tls: failed to verify certificate: x509: certificate signed by unknown authority

tracing output (only some of it):

2024-09-18T13:24:04.612487Z TRACE rustls::server::tls13::client_hello: sending finished Message { version: TLSv1_3, payload: Handshake { parsed: HandshakeMessagePayload { typ: Finished, payload: Finished(97691bcd42d79bf0aa20786b817872281b984195bfd71d2d5c656d2c5ffd063d) }, encoded: 1400002097691bcd42d79bf0aa20786b817872281b984195bfd71d2d5c656d2c5ffd063d } }
2024-09-18T13:24:04.621996Z TRACE rustls::conn: Dropping CCS
2024-09-18T13:24:04.622362Z DEBUG tonic::transport::server::incoming: accept loop error error=received fatal alert: BadCertificate
2024-09-18T13:24:04.622456Z TRACE tonic::transport::server: error accepting connection: received fatal alert: BadCertificate

after the last line the server shutdown.

@marvinlanhenke
Copy link
Author

it seems to me, that rustls is returning an error that is not handled by tonic?

@zier-one
Copy link

Hi @marvinlanhenke, see #1897

@marvinlanhenke
Copy link
Author

@zier-one thanks for pointing me at the issue - I'll guess it's fixed with the next release, thanks again

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