This commit is contained in:
parent
d523c27ae4
commit
43a0fe14b2
5 changed files with 1727 additions and 2283 deletions
1424
Cargo.lock
generated
1424
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
18
Cargo.toml
18
Cargo.toml
|
@ -7,34 +7,34 @@ authors = ["Alex Auvolat <alex@adnab.me>"]
|
||||||
# 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
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = "1.0.28"
|
anyhow = "1.0.66"
|
||||||
envy = "0.4"
|
envy = "0.4"
|
||||||
futures = "0.3"
|
futures = "0.3"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
pretty_env_logger = "0.4"
|
pretty_env_logger = "0.4"
|
||||||
regex = "1"
|
regex = "1"
|
||||||
reqwest = { version = "0.11", default-features = false, features = ["json", "rustls-tls-manual-roots" ] }
|
reqwest = { version = "0.11", default-features = false, features = ["json", "rustls-tls-manual-roots" ] }
|
||||||
serde = { version = "1.0.107", features = ["derive"] }
|
serde = { version = "1.0.149", features = ["derive"] }
|
||||||
serde_json = "1.0.53"
|
serde_json = "1.0.89"
|
||||||
tokio = { version = "1.0", default-features = false, features = ["rt", "rt-multi-thread", "io-util", "net", "time", "macros", "sync", "signal", "fs"] }
|
tokio = { version = "1.22", default-features = false, features = ["rt", "rt-multi-thread", "io-util", "net", "time", "macros", "sync", "signal", "fs"] }
|
||||||
bytes = "1"
|
bytes = "1"
|
||||||
acme-micro = "0.12"
|
acme-micro = "0.12"
|
||||||
rustls = { version = "0.20", features = [ "dangerous_configuration" ] }
|
rustls = { version = "0.20", features = [ "dangerous_configuration" ] }
|
||||||
rustls-pemfile = "0.2"
|
rustls-pemfile = "1.0"
|
||||||
chrono = { version = "0.4", features = [ "serde" ] }
|
chrono = { version = "0.4", features = [ "serde" ] }
|
||||||
hyper = { version = "0.14", features = [ "full" ] }
|
hyper = { version = "0.14", features = [ "full" ] }
|
||||||
futures-util = "0.3"
|
futures-util = "0.3"
|
||||||
tokio-rustls = "0.23"
|
tokio-rustls = "0.23"
|
||||||
hyper-rustls = "0.23"
|
hyper-rustls = "0.23"
|
||||||
http = "0.2"
|
http = "0.2"
|
||||||
hyper-reverse-proxy = "0.4"
|
|
||||||
structopt = "0.3"
|
structopt = "0.3"
|
||||||
glob = "0.3"
|
glob = "0.3"
|
||||||
rcgen = "0.8"
|
rcgen = "0.10"
|
||||||
accept-encoding-fork = "0.2.0-alpha.3"
|
accept-encoding-fork = "0.2.0-alpha.3"
|
||||||
async-compression = { version = "0.3", features = ["tokio", "gzip", "zstd", "deflate", "brotli"] }
|
async-compression = { version = "0.3", features = ["tokio", "gzip", "zstd", "deflate", "brotli"] }
|
||||||
tokio-util = { version = "0.6", features = ["io"] }
|
tokio-util = { version = "0.7", features = ["io"] }
|
||||||
uuid = { version = "0.8.2", features = ["v4"] }
|
uuid = { version = "1.2", features = ["v4"] }
|
||||||
|
|
||||||
dhat = { version = "0.3", optional = true }
|
dhat = { version = "0.3", optional = true }
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
|
|
|
@ -2,7 +2,7 @@ use std::sync::Arc;
|
||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
|
|
||||||
use chrono::{Date, NaiveDate, Utc};
|
use chrono::{NaiveDate, Utc};
|
||||||
use rustls::sign::CertifiedKey;
|
use rustls::sign::CertifiedKey;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
@ -54,8 +54,7 @@ impl Cert {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_old(&self) -> bool {
|
pub fn is_old(&self) -> bool {
|
||||||
let date = Date::<Utc>::from_utc(self.ser.date, Utc);
|
let today = Utc::now().date_naive();
|
||||||
let today = Utc::today();
|
today - self.ser.date > chrono::Duration::days(self.ser.valid_days / 2)
|
||||||
today - date > chrono::Duration::days(self.ser.valid_days / 2)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -278,7 +278,7 @@ impl CertStore {
|
||||||
|
|
||||||
let certser = CertSer {
|
let certser = CertSer {
|
||||||
hostname: domain.to_string(),
|
hostname: domain.to_string(),
|
||||||
date: Utc::today().naive_utc(),
|
date: Utc::now().date_naive(),
|
||||||
valid_days: cert.valid_days_left()?,
|
valid_days: cert.valid_days_left()?,
|
||||||
key_pem,
|
key_pem,
|
||||||
cert_pem,
|
cert_pem,
|
||||||
|
@ -345,7 +345,7 @@ impl CertStore {
|
||||||
|
|
||||||
let certser = CertSer {
|
let certser = CertSer {
|
||||||
hostname: domain.to_string(),
|
hostname: domain.to_string(),
|
||||||
date: Utc::today().naive_utc(),
|
date: Utc::now().date_naive(),
|
||||||
valid_days: 1024,
|
valid_days: 1024,
|
||||||
key_pem: cert.serialize_private_key_pem(),
|
key_pem: cert.serialize_private_key_pem(),
|
||||||
cert_pem: cert.serialize_pem()?,
|
cert_pem: cert.serialize_pem()?,
|
||||||
|
|
Loading…
Reference in a new issue