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

Derive Debug for ProxyStream #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ptwales
Copy link

@ptwales ptwales commented Jan 13, 2022

Hyper-boring's HttpsConnector requires the Response type to implement Debug. Since ProxyStream doesn't implement Debug one cannot create a HttpsConnector<ProxyStream<HttpConnector>> with Boring SSL. Compilation will fail with this error

error[E0277]: `ProxyStream<tokio::net::tcp::stream::TcpStream>` doesn't implement `std::fmt::Debug`
   --> src/lib.rs:75:17
    |
75  |     let https = HttpsConnector::with_connector(proxied, ssl)?;
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ProxyStream<tokio::net::tcp::stream::TcpStream>` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `ProxyStream<tokio::net::tcp::stream::TcpStream>`
note: required by `HttpsConnector::<S>::with_connector`
   --> /home/ptwales/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-boring-2.1.1/src/lib.rs:176:5
    |
176 | /     pub fn with_connector(
177 | |         http: S,
178 | |         ssl: SslConnectorBuilder,
179 | |     ) -> Result<HttpsConnector<S>, ErrorStack> {
    | |______________________________________________^

It's debatable whether the change should go here or in cloudflare/boring/hyper-boring. Hyper-boring is forked from hyper-openssl and while hyper-openssl did originally have that Debug requirement, they dropped it when they upgraded to hyper v0.14. Hyper-boring is also on v0.14 but didn't remove that requirement.

I'm requesting the change be implemented here in hyper-proxy because it's a one line change that won't break anything, whereas it could be many lines and many possible breakages downstream if it was in hyper-boring.

Needed if you want to make an HttpsConnector of a ProxyConnector

Related: sfackler/hyper-native-tls#1
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

Successfully merging this pull request may close these issues.

None yet

1 participant