diff --git a/client/tofu.go b/client/tofu.go index 4524a7a..19c25bf 100644 --- a/client/tofu.go +++ b/client/tofu.go @@ -105,11 +105,9 @@ func handleTofu(cert *x509.Certificate, port string) bool { return false } -// RemoveTofuEntry invalidates the TOFU entry in the database for the given cert and port. -// This will make any cert for that domain valid. -// +// ResetTofuEntry forces the cert passed to be valid, overwriting any previous TOFU entry. // The port string can be empty, to indicate port 1965. -func RemoveTofuEntry(cert *x509.Certificate, port string) { +func ResetTofuEntry(cert *x509.Certificate, port string) { tofuStore.Set(idKey(cert.Subject.CommonName, port), "") tofuStore.WriteConfig() } diff --git a/display/private.go b/display/private.go index 6ef5251..692f7e8 100644 --- a/display/private.go +++ b/display/private.go @@ -228,13 +228,14 @@ func handleURL(u string) (string, bool) { if err == client.ErrTofu { if Tofu(parsed.Host) { // They want to continue anyway - client.RemoveTofuEntry(res.Cert, parsed.Port()) - return handleURL(u) + client.ResetTofuEntry(res.Cert, parsed.Port()) + // Response can be used further down + } else { + // They don't want to continue + // Set the bar back to original URL + bottomBar.SetText(tabMap[curTab].Url) + return "", false } - // They don't want to continue - // Set the bar back to original URL - bottomBar.SetText(tabMap[curTab].Url) - return "", false } else if err != nil { Error("URL Fetch Error", err.Error()) // Set the bar back to original URL