aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorAdnan Maolood <[email protected]>2021-03-04 15:37:00 -0500
committerAdnan Maolood <[email protected]>2021-03-04 15:37:02 -0500
commit8e2ac248301174a03c2c225078cdbb9f0f5a9e38 (patch)
treeab7ec9124006e535610626d105bec1a513df8a1d /examples
parentclient: Remove hostname verification check (diff)
downloadgo-gemini-8e2ac248301174a03c2c225078cdbb9f0f5a9e38.tar.xz
go-gemini-8e2ac248301174a03c2c225078cdbb9f0f5a9e38.zip
tofu: Remove expiration timestamp from known hosts
Diffstat (limited to 'examples')
-rw-r--r--examples/client.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/examples/client.go b/examples/client.go
index 6a4a848..69a928f 100644
--- a/examples/client.go
+++ b/examples/client.go
@@ -16,7 +16,6 @@ import (
"net/url"
"os"
"path/filepath"
- "time"
"git.sr.ht/~adnano/go-gemini"
"git.sr.ht/~adnano/go-gemini/tofu"
@@ -61,10 +60,9 @@ Otherwise, this should be safe to trust.
=> `
func trustCertificate(hostname string, cert *x509.Certificate) error {
- host := tofu.NewHost(hostname, cert.Raw, cert.NotAfter)
-
+ host := tofu.NewHost(hostname, cert.Raw)
knownHost, ok := hosts.Lookup(hostname)
- if ok && time.Now().Before(knownHost.Expires) {
+ if ok {
// Check fingerprint
if bytes.Equal(knownHost.Fingerprint, host.Fingerprint) {
return nil