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

This library depends on OpenSSL #82

Closed
FalkWoldmann opened this issue Jun 15, 2023 · 10 comments · Fixed by #90
Closed

This library depends on OpenSSL #82

FalkWoldmann opened this issue Jun 15, 2023 · 10 comments · Fixed by #90
Labels
enhancement New feature or request

Comments

@FalkWoldmann
Copy link

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.

@aldanor
Copy link

aldanor commented Jun 15, 2023

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...).

@alexliesenfeld
Copy link
Owner

alexliesenfeld commented Jun 19, 2023

@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?

@lcmgh
Copy link

lcmgh commented Jun 22, 2023

Also upvoting this as I spent some effort to make my app not depend on openssl.

@aldanor
Copy link

aldanor commented Jun 23, 2023

@alexliesenfeld Yes this should do it, thanks. However it doesn't look like sagebind/isahc#199 will be merged anytime soon (not earlier than autumn this year according to author)...

@github-actions github-actions bot added the stale label Jul 24, 2023
@github-actions github-actions bot closed this as completed Aug 8, 2023
@alexliesenfeld alexliesenfeld reopened this Aug 8, 2023
@github-actions github-actions bot removed the stale label Aug 9, 2023
@github-actions github-actions bot added the stale label Sep 9, 2023
Repository owner deleted a comment from github-actions bot Sep 9, 2023
Repository owner deleted a comment from github-actions bot Sep 9, 2023
Repository owner deleted a comment from github-actions bot Sep 9, 2023
@FalkWoldmann
Copy link
Author

Would it be possible to migrate to another http client like reqwest?

@labannah9125
Copy link

labannah9125 commented Oct 4, 2023

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 ?

@alexliesenfeld
Copy link
Owner

alexliesenfeld commented Oct 15, 2023

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.

@alexliesenfeld
Copy link
Owner

alexliesenfeld commented Oct 15, 2023

Released version 0.7.0-rc.1 with the discussed changes. Let me know if this solves your problem.

@FalkWoldmann
Copy link
Author

Looks good to me, thanks!

@alexliesenfeld
Copy link
Owner

@FalkWoldmann Nice! Thanks for letting me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants