6 releases

0.4.0 May 15, 2021
0.3.0 Feb 7, 2021
0.2.3 Jan 17, 2021
0.2.2 Jul 10, 2020
0.2.0 Jun 30, 2020

#1128 in Cryptography

Download history 1/week @ 2024-11-13 2/week @ 2024-11-27 7/week @ 2024-12-04 9/week @ 2024-12-11 4/week @ 2024-12-18 52/week @ 2025-01-01 48/week @ 2025-01-29 93/week @ 2025-02-05 14/week @ 2025-02-12 18/week @ 2025-02-19 10/week @ 2025-02-26

180 downloads per month
Used in 2 crates (via krecik)

MIT license

10KB
185 lines

ssl-expiration2

Checks SSL certificate expiration.

Usage

use ssl_expiration2::SslExpiration;

let expiration = SslExpiration::from_domain_name("google.com").unwrap();
if expiration.is_expired() {
    // do something if SSL certificate expired
}
use ssl_expiration2::SslExpiration;

let expiration =
    SslExpiration::from_domain_name("google.com").expect("Domain validation has to work");
if expiration.days() < 14 {
    // SSL certificate will expire in less than 2 weeks, run notification…
}


lib.rs:

Checks SSL certificate expiration.

This crate will try to connect a remote server and check SSL certificate expiration.

Basic usage example:

use ssl_expiration2::SslExpiration;

let expiration = SslExpiration::from_domain_name("google.com").unwrap();
if expiration.is_expired() {
    // do something if SSL certificate expired
}

Check days before expiration example:

use ssl_expiration2::SslExpiration;

let expiration =
    SslExpiration::from_domain_name("google.com").expect("Domain validation has to work");
if expiration.days() < 14 {
    // SSL certificate will expire in less than 2 weeks, run notification…
}

Dependencies

~4–11MB
~127K SLoC