hyperium / hyper-tls

Apache License 2.0
187 stars 96 forks source link

Make tokio dependency optional if possible #89

Open detly opened 3 years ago

detly commented 3 years ago

I tried to use reqwest for making https requests, which means a transitive dependency on hyper, and then this lib for TLS. However despite reqwest's and hyper's tokio dep being optional (I think?), this library appears to unconditionally depend on tokio with default features.

Unfortunately tokio with default features compiles to a binary so big, it will not fit on my embedded device. This is unfortunate, since without it (and using a simpler executor), everything else is pretty lightweight.

I haven't dug very deep into it, but a cursory look suggests that the tokio dependency could be removed or feature gated. Would this be possible?

gosp commented 1 year ago

Does reqwest = { version = "0.11", default-features = false, features = ["native-tls-crate", "blocking", "json"] } work?

Note: remove hyper-tls dependency using default-features = false