avoid overflow of day depending of the month
This commit is contained in:
parent
fc729a0739
commit
8dcaf17356
3 changed files with 4 additions and 4 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -3140,7 +3140,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "wstunnel"
|
||||
version = "10.0.2"
|
||||
version = "10.0.1"
|
||||
dependencies = [
|
||||
"ahash",
|
||||
"anyhow",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "wstunnel"
|
||||
version = "10.0.2"
|
||||
version = "10.0.1"
|
||||
edition = "2021"
|
||||
repository = "https://github.com/erebe/wstunnel.git"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
|
|
@ -15,13 +15,13 @@ pub static TLS_CERTIFICATE: LazyLock<(Vec<CertificateDer<'static>>, PrivateKeyDe
|
|||
let el = now.elapsed();
|
||||
let year = 2024 - (el.as_nanos() % 2) as i32;
|
||||
let month = 1 + (el.as_nanos() % 12) as u8;
|
||||
let day = 1 + (el.as_nanos() % 31) as u8;
|
||||
let day = 1 + (el.as_nanos() % 28) as u8;
|
||||
cert.not_before = date_time_ymd(year, month, day);
|
||||
|
||||
let el = now.elapsed();
|
||||
let year = 2024 + (el.as_nanos() % 50) as i32;
|
||||
let month = 1 + (el.as_nanos() % 12) as u8;
|
||||
let day = 1 + (el.as_nanos() % 31) as u8;
|
||||
let day = 1 + (el.as_nanos() % 28) as u8;
|
||||
cert.not_after = date_time_ymd(year, month, day);
|
||||
|
||||
let cert = cert.self_signed(&key_pair).unwrap().der().clone();
|
||||
|
|
Loading…
Reference in a new issue