Skip to content
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

Simplify & clarify "No TLS" server configuration #1131

Merged
merged 1 commit into from
Jun 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions proxy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,11 +274,9 @@ where
config.outbound_router_capacity,
config.outbound_router_max_idle_age,
);
// No TLS yet.
let (no_tls, _) = tls::ServerConfig::no_tls();
serve(
outbound_listener,
no_tls,
tls::ServerConfig::no_tls(), // No TLS between service & proxy.
router,
config.public_connect_timeout,
config.outbound_ports_disable_protocol_detection,
Expand Down Expand Up @@ -501,12 +499,10 @@ where
h2_builder,
log.clone().executor(),
);
let (no_tls, _) = tls::ServerConfig::no_tls();

let fut = {
let log = log.clone();
bound_port.listen_and_fold(
no_tls,
tls::ServerConfig::no_tls(), // TODO: serve over TLS.
server,
move |server, (session, remote)| {
let log = log.clone().with_remote(remote);
Expand Down
4 changes: 1 addition & 3 deletions proxy/src/telemetry/control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,11 @@ impl Control {
use hyper;

let log = ::logging::admin().server("metrics", bound_port.local_addr());
let (no_tls, _) = ::tls::ServerConfig::no_tls();

let service = self.metrics_service.clone();
let fut = {
let log = log.clone();
bound_port.listen_and_fold(
no_tls, // TODO: Serve over TLS.
::tls::ServerConfig::no_tls(), // TODO: Serve over TLS.
hyper::server::conn::Http::new(),
move |hyper, (conn, remote)| {
let service = service.clone();
Expand Down
10 changes: 3 additions & 7 deletions proxy/src/transport/tls/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,13 +327,9 @@ impl ServerConfig {
ServerConfig(Arc::new(config))
}

pub fn no_tls()
-> (ServerConfigWatch, Box<Future<Item = (), Error = ()> + Send>)
{
let (watch, _) = Watch::new(None);
let no_future = future::ok(());

(watch, Box::new(no_future))
pub fn no_tls() -> ServerConfigWatch {
let (watch, _) = Watch::new(None);
watch
}
}

Expand Down