1
1
Fork 0
mirror of https://tildegit.org/solderpunk/molly-brown synced 2024-05-12 03:46:03 +02:00

Print warning about expired certificates.

This commit is contained in:
Solderpunk 2023-02-23 19:59:11 +01:00
parent 800c181668
commit 0274ef8f35

View File

@ -11,6 +11,7 @@ import (
"strconv" "strconv"
"sync" "sync"
"syscall" "syscall"
"time"
) )
var VERSION = "0.0.0" var VERSION = "0.0.0"
@ -79,6 +80,11 @@ func launch(config Config, privInfo userInfo) int {
log.Println("Invalid TLS certificate: " + err.Error()) log.Println("Invalid TLS certificate: " + err.Error())
return 1 return 1
} }
// Warn if certificate is expired
now := time.Now()
if now.After(certx509.NotAfter) {
log.Println("Hey, your certificate expired on " + certx509.NotAfter.String() + "!!!")
}
// Load certificate and private key // Load certificate and private key
cert, err := tls.LoadX509KeyPair(config.CertPath, config.KeyPath) cert, err := tls.LoadX509KeyPair(config.CertPath, config.KeyPath)