examples/server: Generate new certificates when they expire

This commit is contained in:
adnano
2020-10-13 14:22:15 -04:00
parent a0aa135534
commit db89a34935
5 changed files with 43 additions and 7 deletions
+2
View File
@@ -7,6 +7,7 @@ import (
"crypto/x509"
"fmt"
"io"
"log"
"os"
"path/filepath"
"strconv"
@@ -92,6 +93,7 @@ func (k *KnownHosts) Lookup(hostname string, cert *x509.Certificate) error {
// Certificate is expired
continue
}
log.Print(k.hosts[i].Expires, now)
if k.hosts[i].Fingerprint == fingerprint {
// Fingerprint matches
return nil