This library depends on OpenSSL
Hi,
it seems like this lib depends on OpenSSL being installed on the host system because of the Isahc crate, which itself depends on OpenSSL. It would be nice to introduce a rustls flag so that users do not need to setup OpenSSL on their build systems.
Just noticed the same thing. Would be nice to have a rustls flag to avoid an openssl dependency (however, it doesn't look like isahc supports it...).
@FalkWoldmann , @aldanor Thanks for reaching out. There is already PR #72, but it is blocked by an upstream PR. Do you think it may solve your issue once merged?
Also upvoting this as I spent some effort to make my app not depend on openssl.
@alexliesenfeld Yes this should do it, thanks. However it doesn't look like https://github.com/sagebind/isahc/issues/199 will be merged anytime soon (not earlier than autumn this year according to author)...
Would it be possible to migrate to another http client like reqwest?
ureq is already a dev-dep and could probably replace isahc. i ran into the same trying to write tests for a program on openbsd and compilation fails.
maybe make isahc use a feature or removed instead and let user choose their own client @alexliesenfeld ?
Hi @FalkWoldmann and @labannah9125,
Thank you for your input. After reflecting on the proposed change, I have a few thoughts:
- When httpmock is used as a library only (not for connecting to a remote mock server using MockServer::connect and the like), we can eliminate the need for a real HTTP client altogether. This not only addresses the TLS issues but also reduces the dependency tree by approximately 80 crates!
- Some users reported they also use httpmock as a standalone mock server behind proxies and other infrastructure (like Kubernetes), which may be SSL-enabled. This still requires a real HTTP client i.m.o. For this scenario, I want to hold off until the isahc upstream PR gets merged, as my experience with isahc has been very positive so far. However, to opt into using isahc, users need to enable the “remote” feature flag, which will only be used to connect to remote mock servers. As a consequence, functions like MockServer::connect, MockServer::connect_async, and MockServer::connect_env will only be available when the “remote” feature is turned on.
Please note that this represents a breaking change, but it should not be a problem for most users.
I hope this solves your problems.
Released version 0.7.0-rc.1 with the discussed changes. Let me know if this solves your problem.
Looks good to me, thanks!
@FalkWoldmann Nice! Thanks for letting me know.