-
Notifications
You must be signed in to change notification settings - Fork 113
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
Use rustls instead of OpenSSL #124
Comments
This could be done easily by removing the As a matter of fact, the OpenSSL dependency is not even used on Windows. This project is using So why is So, in order to greatly simplify the building process on Windows (and even on macOS!), we just need to use one of Cargo's feature: Platform specific dependencies! We just need to change the # Add openssl-sys as a direct dependency so it can be cross compiled to
# x86_64-unknown-linux-musl using the "vendored" feature below
+[target.x86_64-unknown-linux-musl.dependencies]
openssl-sys = "0.9.66"
[features]
# Force openssl-sys to staticly link in the openssl library. Necessary when
# cross compiling to x86_64-unknown-linux-musl.
vendored = ["openssl-sys/vendored"] (Tested on Windows, it does not require OpenSSL anymore, not yet tested on other platforms.) |
That is very nice. I would say rustls still might be better than using openssl. What would be the pros and cons of openssl vs rustls in the context of drill? |
As far as I know, Rustls is a nice drop-in replacement of OpenSSL. It's a pure Rust TLS library, only supporting modern protocols like TLS 1.2 and 1.3. The major advantage is portability. Being written in pure Rust, it is portable and statically linked for every target Rust supports (at least Tier 1 ones). No more system library to rely on during compilation and linking of Drill. The major downsides are:
Note that I expected an increase in compilation and linking time, but it seems that it's not the case. In order for Drill to use Rustls the changes below are needed in the Cargo manifest file: url = "2.1.1"
linked-hash-map = "0.5.3"
tokio = { version = "0.2.20", features = ["rt-core", "rt-threaded", "time", "net", "io-driver"] }
-reqwest = { version = "0.10.4", features = ["cookies", "trust-dns"] }
+reqwest = { version = "0.10.4", default-features = false, features = ["rustls-tls", "cookies", "trust-dns"] }
async-trait = "0.1.30"
futures = "0.3.5"
lazy_static = "1.4.0"
num_cpus = "1.13.0"
rand = "0.7.3"
hdrhistogram = "7.4.0"
-
-# Add openssl-sys as a direct dependency so it can be cross compiled to
-# x86_64-unknown-linux-musl using the "vendored" feature below
-openssl-sys = "0.9.66"
-
-[features]
-# Force openssl-sys to staticly link in the openssl library. Necessary when
-# cross compiling to x86_64-unknown-linux-musl.
-vendored = ["openssl-sys/vendored"] This config has been tested (build in release mode and run of an example benchmark) on the following targets:
|
This would greatly simplify building process on Windows. Is this something that can be done?
The text was updated successfully, but these errors were encountered: