Skip to content

Commit

Permalink
Use 'hyper_sync_rustls' for hyper/rustls interop.
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioBenitez committed Jul 12, 2017
1 parent 4609413 commit 85846c2
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 13 deletions.
10 changes: 2 additions & 8 deletions lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ build = "build.rs"
categories = ["web-programming::http-server"]

[features]
tls = ["rustls", "hyper-rustls"]
tls = ["rustls", "hyper-sync-rustls"]

[dependencies]
yansi = { version = "0.3", features = ["nightly"] }
Expand All @@ -33,16 +33,10 @@ pear_codegen = "0.0.10"
rustls = { version = "0.9.0", optional = true }
cookie = { version = "0.9.1", features = ["percent-encode", "secure"] }
hyper = { version = "0.10.11", default-features = false }
hyper-sync-rustls = { version = "0.1", features = ["server"], optional = true }
ordermap = "0.2"
isatty = "0.1"

[dependencies.hyper-rustls]
git = "https://github.com/SergioBenitez/hyper-rustls"
rev = "ef1e8c"
default-features = false
features = ["server"]
optional = true

[dev-dependencies]
lazy_static = "0.2"
rocket_codegen = { version = "0.3.0-dev", path = "../codegen" }
Expand Down
4 changes: 2 additions & 2 deletions lib/src/config/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -490,8 +490,8 @@ impl Config {
/// ```
#[cfg(feature = "tls")]
pub fn set_tls(&mut self, certs_path: &str, key_path: &str) -> Result<()> {
use hyper_rustls::util as tls;
use hyper_rustls::util::Error::Io;
use hyper_sync_rustls::util as tls;
use hyper_sync_rustls::util::Error::Io;
let pem_err = "malformed PEM file";

// Load the certificates.
Expand Down
2 changes: 1 addition & 1 deletion lib/src/data/net_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::io;
use std::net::{SocketAddr, Shutdown};
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 self::NetStream::*;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
#[macro_use] extern crate log;
#[macro_use] extern crate pear;
#[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 hyper;
extern crate url;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/rocket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::mem;
use yansi::Paint;
use state::Container;

#[cfg(feature = "tls")] use hyper_rustls::TlsServer;
#[cfg(feature = "tls")] use hyper_sync_rustls::TlsServer;
use {logger, handler};
use ext::ReadExt;
use config::{self, Config, LoggedValue};
Expand Down

0 comments on commit 85846c2

Please sign in to comment.