You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
https.rs is copy pasted from example directory to src/main.rs
Cargo.toml
[dependencies.nickel]
version = "*"
[dependencies.hyper]
version = "*"
[features]
ssl = ["nickel/ssl"]
Also does not work with, ssl = ["nickel/ssl", "hyper/ssl"]
Error from cargo run --features ssl
src/main.rs:13:12: 13:24 error: the trait bound `hyper::net::Openssl: hyper::net::Ssl` is not satisfied [E0277]
src/main.rs:13 server.listen_https("127.0.0.1:6767", ssl).unwrap();
^~~~~~~~~~~~
src/main.rs:13:12: 13:24 help: run `rustc --explain E0277` to see a detailed explanation
src/main.rs:13:48: 13:54 error: no method named `unwrap` found for type `()` in the current scope
src/main.rs:13 server.listen_https("127.0.0.1:6767", ssl).unwrap();
You should set your versions for nickel and hyper to be in sync, currently the published version of nickel is 0.8 and it's compatible with the 0.8 branch of hyper. The specific error you're seeing is because the Openssl you're using is from the 0.9 hyper and it implements ServerSsl rather than Ssl which was the 0.8 version of the trait. Sadly rustc doesn't give a great error here as it doesn't have any information about crate versions (a cargo concept only last I checked). There's an open issue for cargo around that: rust-lang/cargo#1636
For the second error, "no method named unwrap", the current example code on master hasn't been published yet (holding for another minor breaking change) so you can just remove the unwrap if you're using 0.8.
An alternative, if you want to use the current master, you can set your toml to the following:
[dependencies.nickel]
version = "*"git = "https://github.com/nickel-org/nickel.rs"
But I really recommend you tie yourself to a specific version as generally life gets much easier then!
https.rs
is copy pasted from example directory tosrc/main.rs
Cargo.toml
Also does not work with,
ssl = ["nickel/ssl", "hyper/ssl"]
Error from
cargo run --features ssl
Environment
The text was updated successfully, but these errors were encountered: