Why does solicit 0.4.4 attempt to use openssl 0.9.

2019-07-27 03:35发布

问题:

I have a simple project using the Solicit example to make a request with HTTPS. My Cargo.toml has:

[package]
name = "test"
version = "0.1.0"
authors = ["einchear"]

[dependencies.openssl]
version = "0.7.14"
features = ["tlsv1_2", "npn"]

[dependencies.solicit]
version = "0.4.4"
features = ["tls"]

When I tried to run cargo build, the error is:

error: Package `openssl v0.9.12` does not have these features: `npn, tlsv1_2`

Why 0.9.12 instead 0.7.14?

回答1:

Solicit hasn't released a new version in over a year and a half — 0.4.4 was released 2015-09-07. Version 0.4.3 (0.4.4 doesn't have a git tag for whatever reason) requires any version of openssl, so it's just pulling in the newest possible version. It doesn't matter what you have in your Cargo.toml because it's Solicit's dependencies that matters.

It's no longer even possible to publish a crate to crates.io with a * version dependency!

The current master version of Solicit has pinned to openssl 0.6, which is still an old version.

At this point in time, it doesn't seem like Solicit is an actively developed library. You may wish to investigate alternative solutions or consider contributing patches to update the dependencies.

If you don't need to have any other crates that need OpenSSL support, you might be able to use the master branch version of Solicit and just use the older version of OpenSSL.