quinn-rs / quinn

Async-friendly QUIC implementation in Rust
Apache License 2.0
3.76k stars 380 forks source link

Certificate error #1521

Closed Archieeeeee closed 1 year ago

Archieeeeee commented 1 year ago

error on connection: TransportError(Error { code: Code::crypto(2a), frame: None, reason: "invalid peer certificate contents: invalid peer certificate: UnknownIssuer" })

I am following docs:

let server_config = ServerConfig::with_single_cert(certs, key)?; //using certs generated by LetsEncrypt

let client_config = ClientConfig::with_native_roots();

Cargo.toml:

quinn = {git ="https://github.com/quinn-rs/quinn", rev="ef20b50608c9c3cde8d8d0a69ad8aa38103869ca",  features = ["futures-io", "runtime-tokio", "tls-rustls"]}
rustls = { version = "0.20.4", features = ["dangerous_configuration", "quic"] }
rustls-pemfile = "1.0.2"
rustls-native-certs = "0.6.2"
Ralith commented 1 year ago

There is some issue with your certificate configuration, which cannot be further diagnosed with the information you've provided. Does the same certificate work when used with TLS?

Archieeeeee commented 1 year ago

I'm using fullchain.pem to configure the server and the issue is resolved, thanks