update other binaries

This commit is contained in:
Marcel Märtens 2021-11-19 15:40:59 +01:00
parent 7200cc4ad7
commit aa93b4b53c
8 changed files with 23 additions and 29 deletions

2
Cargo.lock generated
View File

@ -4732,6 +4732,7 @@ version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dac4581f0fc0e0efd529d069e8189ec7b90b8e7680e21beb35141bdc45f36040" checksum = "dac4581f0fc0e0efd529d069e8189ec7b90b8e7680e21beb35141bdc45f36040"
dependencies = [ dependencies = [
"log",
"ring", "ring",
"sct 0.7.0", "sct 0.7.0",
"webpki 0.22.0", "webpki 0.22.0",
@ -6229,6 +6230,7 @@ dependencies = [
"quinn", "quinn",
"rand 0.8.4", "rand 0.8.4",
"rcgen", "rcgen",
"rustls 0.20.1",
"serde", "serde",
"shellexpand", "shellexpand",
"tokio", "tokio",

View File

@ -21,7 +21,7 @@ common-net = { package = "veloren-common-net", path = "../common/net" }
network = { package = "veloren-network", path = "../network", features = ["compression","quic"], default-features = false } network = { package = "veloren-network", path = "../network", features = ["compression","quic"], default-features = false }
byteorder = "1.3.2" byteorder = "1.3.2"
tokio = { version = "1.11", default-features = false, features = ["rt-multi-thread"] } tokio = { version = "1.14", default-features = false, features = ["rt-multi-thread"] }
quinn = "0.8" quinn = "0.8"
image = { version = "0.23.12", default-features = false, features = ["png"] } image = { version = "0.23.12", default-features = false, features = ["png"] }
num = "0.4" num = "0.4"

View File

@ -22,7 +22,7 @@ bincode = "1.3.2"
serde = { version = "1.0" } serde = { version = "1.0" }
#sending #sending
crossbeam-channel = "0.5" crossbeam-channel = "0.5"
tokio = { version = "1.11", default-features = false, features = ["io-util", "macros", "rt", "net", "time"] } tokio = { version = "1.14", default-features = false, features = ["io-util", "macros", "rt", "net", "time"] }
tokio-stream = { version = "0.1.2", default-features = false } tokio-stream = { version = "0.1.2", default-features = false }
#tracing and metrics #tracing and metrics
tracing = { version = "0.1", default-features = false, features = ["attributes"]} tracing = { version = "0.1", default-features = false, features = ["attributes"]}
@ -36,6 +36,7 @@ lazy_static = { version = "1.4", default-features = false }
rand = { version = "0.8" } rand = { version = "0.8" }
#quic support #quic support
quinn = { version = "0.8", optional = true } quinn = { version = "0.8", optional = true }
rustls = "0.20.1"
#stream flags #stream flags
bitflags = "1.2.1" bitflags = "1.2.1"
lz-fear = { version = "0.1.1", optional = true } lz-fear = { version = "0.1.1", optional = true }
@ -47,7 +48,7 @@ hashbrown = { version = ">=0.9, <0.12" }
[dev-dependencies] [dev-dependencies]
tracing-subscriber = { version = "0.2.25", default-features = false, features = ["env-filter", "fmt", "chrono", "ansi", "smallvec"] } tracing-subscriber = { version = "0.2.25", default-features = false, features = ["env-filter", "fmt", "chrono", "ansi", "smallvec"] }
tokio = { version = "1.11", default-features = false, features = ["io-std", "fs", "rt-multi-thread"] } tokio = { version = "1.14", default-features = false, features = ["io-std", "fs", "rt-multi-thread"] }
futures-util = { version = "0.3.7", default-features = false, features = ["sink", "std"] } futures-util = { version = "0.3.7", default-features = false, features = ["sink", "std"] }
clap = { version = "2.33", default-features = false } clap = { version = "2.33", default-features = false }
shellexpand = "2.0.0" shellexpand = "2.0.0"

View File

@ -103,34 +103,28 @@ pub fn quic() -> (ListenAddr, ConnectAddr) {
const LOCALHOST: &str = "localhost"; const LOCALHOST: &str = "localhost";
let port = UDP_PORTS.fetch_add(1, Ordering::Relaxed); let port = UDP_PORTS.fetch_add(1, Ordering::Relaxed);
let transport_config = quinn::TransportConfig::default();
let mut server_config = quinn::ServerConfig::default();
server_config.transport = Arc::new(transport_config);
let mut server_config = quinn::ServerConfigBuilder::new(server_config);
trace!("generating self-signed certificate"); trace!("generating self-signed certificate");
let cert = rcgen::generate_simple_self_signed(vec![LOCALHOST.into()]).unwrap(); let cert = rcgen::generate_simple_self_signed(vec![LOCALHOST.into()]).unwrap();
let key = cert.serialize_private_key_der(); let key = cert.serialize_private_key_der();
let cert = cert.serialize_der().unwrap(); let cert = cert.serialize_der().unwrap();
let key = quinn::PrivateKey::from_der(&key).expect("private key failed"); let key = rustls::PrivateKey(key);
let cert = quinn::Certificate::from_der(&cert).expect("cert failed"); let cert = rustls::Certificate(cert);
server_config
.certificate(quinn::CertificateChain::from_certs(vec![cert.clone()]), key)
.expect("set cert failed");
let server_config = server_config.build(); let mut root_store = rustls::RootCertStore::empty();
root_store.add(&cert).expect("cannot add cert to rootstore");
let mut client_config = quinn::ClientConfigBuilder::default(); let server_config = quinn::ServerConfig::with_single_cert(vec![cert], key)
client_config .expect("Server Config Cert/Key failed");
.add_certificate_authority(cert) let client_config = quinn::ClientConfig::with_root_certificates(root_store);
.expect("adding certificate failed"); use std::net::{IpAddr, Ipv4Addr};
let client_config = client_config.build();
( (
ListenAddr::Quic(SocketAddr::from(([127, 0, 0, 1], port)), server_config), ListenAddr::Quic(
SocketAddr::new(IpAddr::V4(Ipv4Addr::LOCALHOST), port),
server_config,
),
ConnectAddr::Quic( ConnectAddr::Quic(
SocketAddr::from(([127, 0, 0, 1], port)), SocketAddr::new(IpAddr::V4(Ipv4Addr::LOCALHOST), port),
client_config, client_config,
LOCALHOST.to_owned(), LOCALHOST.to_owned(),
), ),

View File

@ -31,7 +31,7 @@ common-base = { package = "veloren-common-base", path = "../common/base" }
common-net = { package = "veloren-common-net", path = "../common/net" } common-net = { package = "veloren-common-net", path = "../common/net" }
common-frontend = { package = "veloren-common-frontend", path = "../common/frontend" } common-frontend = { package = "veloren-common-frontend", path = "../common/frontend" }
tokio = { version = "1.11", default-features = false, features = ["rt-multi-thread"] } tokio = { version = "1.14", default-features = false, features = ["rt-multi-thread"] }
num_cpus = "1.0" num_cpus = "1.0"
ansi-parser = "0.8" ansi-parser = "0.8"
clap = "2.33" clap = "2.33"

View File

@ -34,7 +34,7 @@ num_cpus = "1.0"
tracing = "0.1" tracing = "0.1"
vek = { version = "0.14.1", features = ["serde"] } vek = { version = "0.14.1", features = ["serde"] }
futures-util = "0.3.7" futures-util = "0.3.7"
tokio = { version = "1.11", default-features = false, features = ["rt"] } tokio = { version = "1.14", default-features = false, features = ["rt"] }
prometheus-hyper = "0.1.2" prometheus-hyper = "0.1.2"
quinn = "0.8" quinn = "0.8"
rustls = { version = "0.20", default-features = false } rustls = { version = "0.20", default-features = false }

View File

@ -487,10 +487,7 @@ impl Server {
} else { } else {
debug!("convert pem cert to der"); debug!("convert pem cert to der");
let certs = rustls_pemfile::certs(&mut cert_chain.as_slice())?; let certs = rustls_pemfile::certs(&mut cert_chain.as_slice())?;
certs certs.into_iter().map(rustls::Certificate).collect()
.into_iter()
.map(|cert| rustls::Certificate(cert))
.collect()
}; };
let server_config = quinn::ServerConfig::with_single_cert(cert_chain, key)?; let server_config = quinn::ServerConfig::with_single_cert(cert_chain, key)?;
Ok(server_config) Ok(server_config)

View File

@ -236,7 +236,7 @@ fn palette(conn: Connection) -> Result<(), Box<dyn Error>> {
} }
} }
let mut f = File::create("palettes.ron")?; let mut f = File::create("palettes.ron")?;
let pretty = ron::ser::PrettyConfig::default().with_depth_limit(2); let pretty = ron::ser::PrettyConfig::default().depth_limit(2);
write!(f, "{}", ron::ser::to_string_pretty(&palettes, pretty)?)?; write!(f, "{}", ron::ser::to_string_pretty(&palettes, pretty)?)?;
Ok(()) Ok(())
} }