From 0274ef8f3592a6ca18278120b9d1a76a4529e879 Mon Sep 17 00:00:00 2001 From: Solderpunk Date: Thu, 23 Feb 2023 19:59:11 +0100 Subject: [PATCH] Print warning about expired certificates. --- launch.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/launch.go b/launch.go index 6968709..42658e2 100644 --- a/launch.go +++ b/launch.go @@ -11,6 +11,7 @@ import ( "strconv" "sync" "syscall" + "time" ) var VERSION = "0.0.0" @@ -79,6 +80,11 @@ func launch(config Config, privInfo userInfo) int { log.Println("Invalid TLS certificate: " + err.Error()) 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 cert, err := tls.LoadX509KeyPair(config.CertPath, config.KeyPath)