mirror of https://github.com/linkerd/linkerd2.git
Simplify & clarify "No TLS" server configuration (#1131)
The same pattern will be used for the "No TLS" client configuration. Signed-off-by: Brian Smith <brian@briansmith.org>
This commit is contained in:
parent
be2d878fba
commit
110d91e667
|
@ -274,11 +274,9 @@ where
|
||||||
config.outbound_router_capacity,
|
config.outbound_router_capacity,
|
||||||
config.outbound_router_max_idle_age,
|
config.outbound_router_max_idle_age,
|
||||||
);
|
);
|
||||||
// No TLS yet.
|
|
||||||
let (no_tls, _) = tls::ServerConfig::no_tls();
|
|
||||||
serve(
|
serve(
|
||||||
outbound_listener,
|
outbound_listener,
|
||||||
no_tls,
|
tls::ServerConfig::no_tls(), // No TLS between service & proxy.
|
||||||
router,
|
router,
|
||||||
config.public_connect_timeout,
|
config.public_connect_timeout,
|
||||||
config.outbound_ports_disable_protocol_detection,
|
config.outbound_ports_disable_protocol_detection,
|
||||||
|
@ -501,12 +499,10 @@ where
|
||||||
h2_builder,
|
h2_builder,
|
||||||
log.clone().executor(),
|
log.clone().executor(),
|
||||||
);
|
);
|
||||||
let (no_tls, _) = tls::ServerConfig::no_tls();
|
|
||||||
|
|
||||||
let fut = {
|
let fut = {
|
||||||
let log = log.clone();
|
let log = log.clone();
|
||||||
bound_port.listen_and_fold(
|
bound_port.listen_and_fold(
|
||||||
no_tls,
|
tls::ServerConfig::no_tls(), // TODO: serve over TLS.
|
||||||
server,
|
server,
|
||||||
move |server, (session, remote)| {
|
move |server, (session, remote)| {
|
||||||
let log = log.clone().with_remote(remote);
|
let log = log.clone().with_remote(remote);
|
||||||
|
|
|
@ -98,13 +98,11 @@ impl Control {
|
||||||
use hyper;
|
use hyper;
|
||||||
|
|
||||||
let log = ::logging::admin().server("metrics", bound_port.local_addr());
|
let log = ::logging::admin().server("metrics", bound_port.local_addr());
|
||||||
let (no_tls, _) = ::tls::ServerConfig::no_tls();
|
|
||||||
|
|
||||||
let service = self.metrics_service.clone();
|
let service = self.metrics_service.clone();
|
||||||
let fut = {
|
let fut = {
|
||||||
let log = log.clone();
|
let log = log.clone();
|
||||||
bound_port.listen_and_fold(
|
bound_port.listen_and_fold(
|
||||||
no_tls, // TODO: Serve over TLS.
|
::tls::ServerConfig::no_tls(), // TODO: Serve over TLS.
|
||||||
hyper::server::conn::Http::new(),
|
hyper::server::conn::Http::new(),
|
||||||
move |hyper, (conn, remote)| {
|
move |hyper, (conn, remote)| {
|
||||||
let service = service.clone();
|
let service = service.clone();
|
||||||
|
|
|
@ -327,13 +327,9 @@ impl ServerConfig {
|
||||||
ServerConfig(Arc::new(config))
|
ServerConfig(Arc::new(config))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn no_tls()
|
pub fn no_tls() -> ServerConfigWatch {
|
||||||
-> (ServerConfigWatch, Box<Future<Item = (), Error = ()> + Send>)
|
let (watch, _) = Watch::new(None);
|
||||||
{
|
watch
|
||||||
let (watch, _) = Watch::new(None);
|
|
||||||
let no_future = future::ok(());
|
|
||||||
|
|
||||||
(watch, Box::new(no_future))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue