BiagioFesta / wtransport

Async-friendly WebTransport implementation in Rust
Apache License 2.0
346 stars 19 forks source link

Expose the server certificate hashes cert verifier for external use #169

Closed MOZGIII closed 1 month ago

MOZGIII commented 2 months ago

I am building an experimental protocol and trying a few different backing transport implementations - so far custom rustls-backed, quinn and wtransport.

I found myself in the position where I'd really like to use the WebTransport custom certificate verification logic (the serverCertificateHashes check) for all the transport layers, and not only WebTransport.

Currently I have built a simplified implementation of the rustls::client::ServerCertVerifier that does that, and since I want the same code everywhere I'm even using it for wtransport too.

However, I'd rather use wtransport's implementation.

What do you think of making it available as a separate crate, like wtransport-server-cert-verifier with a wtransport_server_cert_verifier::HashesVerifier inside?

Having something like that would enable anyone to have a verifier that is WebTransport specific without having to write a custom one, and a separate crate would eliminate the wtransport implementation of the actual protocol (and its dependencies like quinn) where it isn't needed.