chore: refactor
This commit is contained in:
parent
d96246b1ef
commit
a4741127a5
6 changed files with 16 additions and 31 deletions
|
|
@ -2,6 +2,10 @@
|
||||||
|
|
||||||
## 0.8.0 (Unreleased)
|
## 0.8.0 (Unreleased)
|
||||||
|
|
||||||
|
## 0.7.1
|
||||||
|
|
||||||
|
- deps and patches
|
||||||
|
|
||||||
## 0.7.0
|
## 0.7.0
|
||||||
|
|
||||||
### Important Changes
|
### Important Changes
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
version = "0.7.0"
|
version = "0.7.1"
|
||||||
authors = ["Jun Kurihara"]
|
authors = ["Jun Kurihara"]
|
||||||
homepage = "https://github.com/junkurihara/rust-rpxy"
|
homepage = "https://github.com/junkurihara/rust-rpxy"
|
||||||
repository = "https://github.com/junkurihara/rust-rpxy"
|
repository = "https://github.com/junkurihara/rust-rpxy"
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,8 @@ publish.workspace = true
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["http3-quinn", "cache", "rustls-backend"]
|
# default = ["http3-quinn", "cache", "rustls-backend"]
|
||||||
|
default = ["http3-s2n", "cache", "native-tls-backend"]
|
||||||
http3-quinn = ["rpxy-lib/http3-quinn"]
|
http3-quinn = ["rpxy-lib/http3-quinn"]
|
||||||
http3-s2n = ["rpxy-lib/http3-s2n"]
|
http3-s2n = ["rpxy-lib/http3-s2n"]
|
||||||
native-tls-backend = ["rpxy-lib/native-tls-backend"]
|
native-tls-backend = ["rpxy-lib/native-tls-backend"]
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,8 @@ publish.workspace = true
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["http3-quinn", "sticky-cookie", "cache", "rustls-backend"]
|
# default = ["http3-quinn", "sticky-cookie", "cache", "rustls-backend"]
|
||||||
|
default = ["http3-s2n", "sticky-cookie", "cache", "rustls-backend"]
|
||||||
http3-quinn = ["socket2", "quinn", "h3", "h3-quinn"]
|
http3-quinn = ["socket2", "quinn", "h3", "h3-quinn"]
|
||||||
http3-s2n = [
|
http3-s2n = [
|
||||||
"h3",
|
"h3",
|
||||||
|
|
|
||||||
|
|
@ -99,11 +99,7 @@ impl ServerCryptoBase {
|
||||||
|
|
||||||
// add server certificate and key
|
// add server certificate and key
|
||||||
if let Err(e) = resolver_local.add(server_name.as_str(), certified_key.to_owned()) {
|
if let Err(e) = resolver_local.add(server_name.as_str(), certified_key.to_owned()) {
|
||||||
error!(
|
error!("{}: Failed to read some certificates and keys {}", server_name.as_str(), e)
|
||||||
"{}: Failed to read some certificates and keys {}",
|
|
||||||
server_name.as_str(),
|
|
||||||
e
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// add client certificate if specified
|
// add client certificate if specified
|
||||||
|
|
@ -114,11 +110,7 @@ impl ServerCryptoBase {
|
||||||
client_ca_roots_local.add_trust_anchors(owned_trust_anchors.into_iter());
|
client_ca_roots_local.add_trust_anchors(owned_trust_anchors.into_iter());
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
warn!(
|
warn!("Failed to add client CA certificate for {}: {}", server_name.as_str(), e);
|
||||||
"Failed to add client CA certificate for {}: {}",
|
|
||||||
server_name.as_str(),
|
|
||||||
e
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -174,11 +166,7 @@ impl ServerCryptoBase {
|
||||||
if certs_and_keys.client_ca_certs.is_none() {
|
if certs_and_keys.client_ca_certs.is_none() {
|
||||||
// aggregated server config for no client auth server for http3
|
// aggregated server config for no client auth server for http3
|
||||||
if let Err(e) = resolver_global.add(server_name.as_str(), certified_key) {
|
if let Err(e) = resolver_global.add(server_name.as_str(), certified_key) {
|
||||||
error!(
|
error!("{}: Failed to read some certificates and keys {}", server_name.as_str(), e)
|
||||||
"{}: Failed to read some certificates and keys {}",
|
|
||||||
server_name.as_str(),
|
|
||||||
e
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -216,15 +204,11 @@ impl ServerCryptoBase {
|
||||||
if certs_and_keys.client_ca_certs.is_none() {
|
if certs_and_keys.client_ca_certs.is_none() {
|
||||||
// aggregated server config for no client auth server for http3
|
// aggregated server config for no client auth server for http3
|
||||||
if let Err(e) = resolver_global.add(server_name.as_str(), certified_key) {
|
if let Err(e) = resolver_global.add(server_name.as_str(), certified_key) {
|
||||||
error!(
|
error!("{}: Failed to read some certificates and keys {}", server_name.as_str(), e)
|
||||||
"{}: Failed to read some certificates and keys {}",
|
|
||||||
server_name.as_str(),
|
|
||||||
e
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let alpn = vec![
|
let alpn = [
|
||||||
b"h3".to_vec(),
|
b"h3".to_vec(),
|
||||||
b"hq-29".to_vec(), // TODO: remove later?
|
b"hq-29".to_vec(), // TODO: remove later?
|
||||||
b"h2".to_vec(),
|
b"h2".to_vec(),
|
||||||
|
|
@ -257,12 +241,7 @@ fn parse_server_certs_and_keys_s2n(
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.ok_or_else(|| {
|
.ok_or_else(|| std::io::Error::new(std::io::ErrorKind::InvalidInput, "Unable to find a valid certificate and key"))?;
|
||||||
std::io::Error::new(
|
|
||||||
std::io::ErrorKind::InvalidInput,
|
|
||||||
"Unable to find a valid certificate and key",
|
|
||||||
)
|
|
||||||
})?;
|
|
||||||
let certs: Vec<_> = certs_and_keys
|
let certs: Vec<_> = certs_and_keys
|
||||||
.certs
|
.certs
|
||||||
.iter()
|
.iter()
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit b44edeb60d234d49c45828395108f7519a048d4b
|
Subproject commit e7c7ab9d634ef73784d6cbc424a270dbaa4f1c99
|
||||||
Loading…
Add table
Add a link
Reference in a new issue