Merges 2.0.0 into master for final release #106
11
client.go
11
client.go
|
@ -289,8 +289,15 @@ func (c *client) simpleCommand(action string) {
|
|||
case "B", "BOOKMARKS":
|
||||
c.BookMarks.ToggleOpen()
|
||||
c.Draw()
|
||||
case "R", "REFRESH":
|
||||
// TODO build refresh code
|
||||
case "R", "RELOAD":
|
||||
c.ClearMessage()
|
||||
err := c.ReloadPage()
|
||||
if err != nil {
|
||||
c.SetMessage(err.Error(), false)
|
||||
c.DrawMessage()
|
||||
} else {
|
||||
c.Draw()
|
||||
}
|
||||
case "SEARCH":
|
||||
c.search("", "", "?")
|
||||
case "HELP", "?":
|
||||
|
|
|
@ -69,7 +69,7 @@ func (s *scanner) scanText() Token {
|
|||
capInput := strings.ToUpper(buf.String())
|
||||
switch capInput {
|
||||
case "D", "DELETE", "A", "ADD","W", "WRITE",
|
||||
"S", "SET", "R", "REFRESH", "SEARCH",
|
||||
"S", "SET", "R", "RELOAD", "SEARCH",
|
||||
"Q", "QUIT", "B", "BOOKMARKS", "H",
|
||||
"HOME", "?", "HELP", "C", "CHECK",
|
||||
"P", "PURGE":
|
||||
|
|
|
@ -100,17 +100,24 @@ func (t *TofuDigest) Match(host string, cState *tls.ConnectionState) error {
|
|||
func (t *TofuDigest) newCert(host string, cState *tls.ConnectionState) error {
|
||||
host = strings.ToLower(host)
|
||||
now := time.Now()
|
||||
var reasons strings.Builder
|
||||
|
||||
for _, cert := range cState.PeerCertificates {
|
||||
for index, cert := range cState.PeerCertificates {
|
||||
if index > 0 {
|
||||
reasons.WriteString("; ")
|
||||
}
|
||||
if now.Before(cert.NotBefore) {
|
||||
reasons.WriteString(fmt.Sprintf("Cert [%d] is not valid yet", index + 1))
|
||||
continue
|
||||
}
|
||||
|
||||
if now.After(cert.NotAfter) {
|
||||
reasons.WriteString(fmt.Sprintf("Cert [%d] is expired", index + 1))
|
||||
continue
|
||||
}
|
||||
|
||||
if err := cert.VerifyHostname(host); err != nil {
|
||||
reasons.WriteString(fmt.Sprintf("Cert [%d] hostname does not match", index + 1))
|
||||
continue
|
||||
}
|
||||
|
||||
|
@ -118,7 +125,7 @@ func (t *TofuDigest) newCert(host string, cState *tls.ConnectionState) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
return fmt.Errorf("No valid certificates were offered by host %q", host)
|
||||
return fmt.Errorf(reasons.String())
|
||||
}
|
||||
|
||||
func (t *TofuDigest) IniDump() string {
|
||||
|
|
Loading…
Reference in New Issue