Use 'hyper_sync_rustls' for hyper/rustls interop.

This commit is contained in:
Sergio Benitez 2017-07-12 04:13:46 -07:00
parent 4609413828
commit 85846c2af1
5 changed files with 7 additions and 13 deletions

View File

@ -15,7 +15,7 @@ build = "build.rs"
categories = ["web-programming::http-server"] categories = ["web-programming::http-server"]
[features] [features]
tls = ["rustls", "hyper-rustls"] tls = ["rustls", "hyper-sync-rustls"]
[dependencies] [dependencies]
yansi = { version = "0.3", features = ["nightly"] } yansi = { version = "0.3", features = ["nightly"] }
@ -33,16 +33,10 @@ pear_codegen = "0.0.10"
rustls = { version = "0.9.0", optional = true } rustls = { version = "0.9.0", optional = true }
cookie = { version = "0.9.1", features = ["percent-encode", "secure"] } cookie = { version = "0.9.1", features = ["percent-encode", "secure"] }
hyper = { version = "0.10.11", default-features = false } hyper = { version = "0.10.11", default-features = false }
hyper-sync-rustls = { version = "0.1", features = ["server"], optional = true }
ordermap = "0.2" ordermap = "0.2"
isatty = "0.1" isatty = "0.1"
[dependencies.hyper-rustls]
git = "https://github.com/SergioBenitez/hyper-rustls"
rev = "ef1e8c"
default-features = false
features = ["server"]
optional = true
[dev-dependencies] [dev-dependencies]
lazy_static = "0.2" lazy_static = "0.2"
rocket_codegen = { version = "0.3.0-dev", path = "../codegen" } rocket_codegen = { version = "0.3.0-dev", path = "../codegen" }

View File

@ -490,8 +490,8 @@ impl Config {
/// ``` /// ```
#[cfg(feature = "tls")] #[cfg(feature = "tls")]
pub fn set_tls(&mut self, certs_path: &str, key_path: &str) -> Result<()> { pub fn set_tls(&mut self, certs_path: &str, key_path: &str) -> Result<()> {
use hyper_rustls::util as tls; use hyper_sync_rustls::util as tls;
use hyper_rustls::util::Error::Io; use hyper_sync_rustls::util::Error::Io;
let pem_err = "malformed PEM file"; let pem_err = "malformed PEM file";
// Load the certificates. // Load the certificates.

View File

@ -2,7 +2,7 @@ use std::io;
use std::net::{SocketAddr, Shutdown}; use std::net::{SocketAddr, Shutdown};
use std::time::Duration; use std::time::Duration;
#[cfg(feature = "tls")] use hyper_rustls::{WrappedStream, ServerSession}; #[cfg(feature = "tls")] use hyper_sync_rustls::{WrappedStream, ServerSession};
use http::hyper::net::{HttpStream, NetworkStream}; use http::hyper::net::{HttpStream, NetworkStream};
use self::NetStream::*; use self::NetStream::*;

View File

@ -102,7 +102,7 @@
#[macro_use] extern crate log; #[macro_use] extern crate log;
#[macro_use] extern crate pear; #[macro_use] extern crate pear;
#[cfg(feature = "tls")] extern crate rustls; #[cfg(feature = "tls")] extern crate rustls;
#[cfg(feature = "tls")] extern crate hyper_rustls; #[cfg(feature = "tls")] extern crate hyper_sync_rustls;
extern crate yansi; extern crate yansi;
extern crate hyper; extern crate hyper;
extern crate url; extern crate url;

View File

@ -8,7 +8,7 @@ use std::mem;
use yansi::Paint; use yansi::Paint;
use state::Container; use state::Container;
#[cfg(feature = "tls")] use hyper_rustls::TlsServer; #[cfg(feature = "tls")] use hyper_sync_rustls::TlsServer;
use {logger, handler}; use {logger, handler};
use ext::ReadExt; use ext::ReadExt;
use config::{self, Config, LoggedValue}; use config::{self, Config, LoggedValue};