diff --git a/Cargo.toml b/Cargo.toml
index 027e9276..15e4fea5 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -12,6 +12,7 @@ RustyVault's RESTful API is designed to be fully compatible with Hashicorp Vault
"""
repository = "https://github.com/Tongsuo-Project/RustyVault"
documentation = "https://docs.rs/rusty_vault/latest/rusty_vault/"
+build = "build.rs"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@@ -24,8 +25,8 @@ serde_json = "^1.0"
serde_bytes = "0.11"
go-defer = "^0.1"
rand = "^0.8"
-openssl = "0.10"
-openssl-sys = "0.9.92"
+openssl = { version = "0.10" }
+openssl-sys = { version = "0.9" }
derivative = "2.2.0"
enum-map = "2.6.1"
strum = { version = "0.25", features = ["derive"] }
@@ -60,6 +61,11 @@ serde_asn1_der = "0.8"
base64 = "0.22"
etcd-client = { version = "0.12.4", features = ["tls"] }
tokio = "1.37.0"
+ipnetwork = "0.20"
+
+[patch.crates-io]
+openssl = { git = "https://github.com/Tongsuo-Project/rust-tongsuo.git" }
+openssl-sys = { git = "https://github.com/Tongsuo-Project/rust-tongsuo.git" }
[features]
storage_mysql = ["diesel", "r2d2", "r2d2-diesel"]
diff --git a/build.rs b/build.rs
new file mode 100644
index 00000000..2c0ca9ea
--- /dev/null
+++ b/build.rs
@@ -0,0 +1,7 @@
+use std::env;
+
+fn main() {
+ if let Ok(_) = env::var("DEP_OPENSSL_TONGSUO") {
+ println!("cargo:rustc-cfg=tongsuo");
+ }
+}
diff --git a/src/errors.rs b/src/errors.rs
index f8bdcd72..53eabf1c 100644
--- a/src/errors.rs
+++ b/src/errors.rs
@@ -234,6 +234,16 @@ pub enum RvError {
#[from]
source: crate::storage::physical::error::BackendError,
},
+ #[error("Some net addr parse error happened, {:?}", .source)]
+ AddrParseError {
+ #[from]
+ source: std::net::AddrParseError,
+ },
+ #[error("Some ipnetwork error happened, {:?}", .source)]
+ IpNetworkError {
+ #[from]
+ source: ipnetwork::IpNetworkError,
+ },
/// Database Errors Begin
///
diff --git a/src/modules/pki/path_config_ca.rs b/src/modules/pki/path_config_ca.rs
index 56b41d8a..98120ded 100644
--- a/src/modules/pki/path_config_ca.rs
+++ b/src/modules/pki/path_config_ca.rs
@@ -46,7 +46,7 @@ For security reasons, you can only view the certificate when reading this endpoi
impl PkiBackendInner {
pub fn write_path_ca(&self, _backend: &dyn Backend, req: &mut Request) -> Result