pierresouchay / consul-rust

Rust client libray for Consul HTTP API
Apache License 2.0
92 stars 48 forks source link

Hyper to reqwest #21

Closed knusbaum closed 5 years ago

knusbaum commented 5 years ago

Problem

The version of hyper and openssl that this project uses are outdated and don't work with newer openssl and libressl.

openssl-sys v0.9.23 ...
This crate is only compatible with OpenSSL 1.0.1, 1.0.2, and 1.1.0, or LibreSSL
2.5 and 2.6.0, but a different version of OpenSSL was found. The build is now
aborting due to this version mismatch.

Solution

One solution was to update the hyper and openssl versions, but hyper's API has changed significantly and gotten much more complicated. Instead, I opted to replace hyper with the reqwest library. reqwest is a convenience wrapper around hyper, and is even recommended by the hyper project. From https://github.com/hyperium/hyper:

Hyper is a relatively low-level library, if you are looking for simple high-level HTTP
client, then you may wish to consider reqwest, which is built on top of this library.

This library only does simple synchronous HTTP calls, and reqwest is totally sufficient for these purposes.

stusmall commented 5 years ago

In the most recent refactor I've moved it over to a recent version of reqwest