mirror of
https://tildegit.org/solderpunk/molly-brown.git
synced 2025-04-13 09:29:46 +00:00
Print warning about expired certificates.
This commit is contained in:
parent
800c181668
commit
0274ef8f35
1 changed files with 6 additions and 0 deletions
|
@ -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)
|
||||||
|
|
Loading…
Add table
Reference in a new issue