mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
update other binaries
This commit is contained in:
parent
7200cc4ad7
commit
aa93b4b53c
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -4732,6 +4732,7 @@ version = "0.20.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dac4581f0fc0e0efd529d069e8189ec7b90b8e7680e21beb35141bdc45f36040"
|
||||
dependencies = [
|
||||
"log",
|
||||
"ring",
|
||||
"sct 0.7.0",
|
||||
"webpki 0.22.0",
|
||||
@ -6229,6 +6230,7 @@ dependencies = [
|
||||
"quinn",
|
||||
"rand 0.8.4",
|
||||
"rcgen",
|
||||
"rustls 0.20.1",
|
||||
"serde",
|
||||
"shellexpand",
|
||||
"tokio",
|
||||
|
@ -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 }
|
||||
|
||||
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"
|
||||
image = { version = "0.23.12", default-features = false, features = ["png"] }
|
||||
num = "0.4"
|
||||
|
@ -22,7 +22,7 @@ bincode = "1.3.2"
|
||||
serde = { version = "1.0" }
|
||||
#sending
|
||||
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 }
|
||||
#tracing and metrics
|
||||
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" }
|
||||
#quic support
|
||||
quinn = { version = "0.8", optional = true }
|
||||
rustls = "0.20.1"
|
||||
#stream flags
|
||||
bitflags = "1.2.1"
|
||||
lz-fear = { version = "0.1.1", optional = true }
|
||||
@ -47,7 +48,7 @@ hashbrown = { version = ">=0.9, <0.12" }
|
||||
|
||||
[dev-dependencies]
|
||||
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"] }
|
||||
clap = { version = "2.33", default-features = false }
|
||||
shellexpand = "2.0.0"
|
||||
|
@ -103,34 +103,28 @@ pub fn quic() -> (ListenAddr, ConnectAddr) {
|
||||
const LOCALHOST: &str = "localhost";
|
||||
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");
|
||||
let cert = rcgen::generate_simple_self_signed(vec![LOCALHOST.into()]).unwrap();
|
||||
let key = cert.serialize_private_key_der();
|
||||
let cert = cert.serialize_der().unwrap();
|
||||
|
||||
let key = quinn::PrivateKey::from_der(&key).expect("private key failed");
|
||||
let cert = quinn::Certificate::from_der(&cert).expect("cert failed");
|
||||
server_config
|
||||
.certificate(quinn::CertificateChain::from_certs(vec![cert.clone()]), key)
|
||||
.expect("set cert failed");
|
||||
let key = rustls::PrivateKey(key);
|
||||
let cert = rustls::Certificate(cert);
|
||||
|
||||
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();
|
||||
client_config
|
||||
.add_certificate_authority(cert)
|
||||
.expect("adding certificate failed");
|
||||
|
||||
let client_config = client_config.build();
|
||||
let server_config = quinn::ServerConfig::with_single_cert(vec![cert], key)
|
||||
.expect("Server Config Cert/Key failed");
|
||||
let client_config = quinn::ClientConfig::with_root_certificates(root_store);
|
||||
use std::net::{IpAddr, Ipv4Addr};
|
||||
(
|
||||
ListenAddr::Quic(SocketAddr::from(([127, 0, 0, 1], port)), server_config),
|
||||
ListenAddr::Quic(
|
||||
SocketAddr::new(IpAddr::V4(Ipv4Addr::LOCALHOST), port),
|
||||
server_config,
|
||||
),
|
||||
ConnectAddr::Quic(
|
||||
SocketAddr::from(([127, 0, 0, 1], port)),
|
||||
SocketAddr::new(IpAddr::V4(Ipv4Addr::LOCALHOST), port),
|
||||
client_config,
|
||||
LOCALHOST.to_owned(),
|
||||
),
|
||||
|
@ -31,7 +31,7 @@ common-base = { package = "veloren-common-base", path = "../common/base" }
|
||||
common-net = { package = "veloren-common-net", path = "../common/net" }
|
||||
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"
|
||||
ansi-parser = "0.8"
|
||||
clap = "2.33"
|
||||
|
@ -34,7 +34,7 @@ num_cpus = "1.0"
|
||||
tracing = "0.1"
|
||||
vek = { version = "0.14.1", features = ["serde"] }
|
||||
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"
|
||||
quinn = "0.8"
|
||||
rustls = { version = "0.20", default-features = false }
|
||||
|
@ -487,10 +487,7 @@ impl Server {
|
||||
} else {
|
||||
debug!("convert pem cert to der");
|
||||
let certs = rustls_pemfile::certs(&mut cert_chain.as_slice())?;
|
||||
certs
|
||||
.into_iter()
|
||||
.map(|cert| rustls::Certificate(cert))
|
||||
.collect()
|
||||
certs.into_iter().map(rustls::Certificate).collect()
|
||||
};
|
||||
let server_config = quinn::ServerConfig::with_single_cert(cert_chain, key)?;
|
||||
Ok(server_config)
|
||||
|
@ -236,7 +236,7 @@ fn palette(conn: Connection) -> Result<(), Box<dyn Error>> {
|
||||
}
|
||||
}
|
||||
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)?)?;
|
||||
Ok(())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user