Merges 2.0.0 into master for final release #106

Manually merged
sloum merged 195 commits from develop into master 2019-12-01 17:10:03 +00:00
3 changed files with 19 additions and 5 deletions
Showing only changes of commit 9e8e7ee5b1 - Show all commits

View File

@ -289,8 +289,15 @@ func (c *client) simpleCommand(action string) {
case "B", "BOOKMARKS": case "B", "BOOKMARKS":
c.BookMarks.ToggleOpen() c.BookMarks.ToggleOpen()
c.Draw() c.Draw()
case "R", "REFRESH": case "R", "RELOAD":
// TODO build refresh code c.ClearMessage()
err := c.ReloadPage()
if err != nil {
c.SetMessage(err.Error(), false)
c.DrawMessage()
} else {
c.Draw()
}
case "SEARCH": case "SEARCH":
c.search("", "", "?") c.search("", "", "?")
case "HELP", "?": case "HELP", "?":

View File

@ -69,7 +69,7 @@ func (s *scanner) scanText() Token {
capInput := strings.ToUpper(buf.String()) capInput := strings.ToUpper(buf.String())
switch capInput { switch capInput {
case "D", "DELETE", "A", "ADD","W", "WRITE", case "D", "DELETE", "A", "ADD","W", "WRITE",
"S", "SET", "R", "REFRESH", "SEARCH", "S", "SET", "R", "RELOAD", "SEARCH",
"Q", "QUIT", "B", "BOOKMARKS", "H", "Q", "QUIT", "B", "BOOKMARKS", "H",
"HOME", "?", "HELP", "C", "CHECK", "HOME", "?", "HELP", "C", "CHECK",
"P", "PURGE": "P", "PURGE":

View File

@ -100,17 +100,24 @@ func (t *TofuDigest) Match(host string, cState *tls.ConnectionState) error {
func (t *TofuDigest) newCert(host string, cState *tls.ConnectionState) error { func (t *TofuDigest) newCert(host string, cState *tls.ConnectionState) error {
host = strings.ToLower(host) host = strings.ToLower(host)
now := time.Now() 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) { if now.Before(cert.NotBefore) {
reasons.WriteString(fmt.Sprintf("Cert [%d] is not valid yet", index + 1))
continue continue
} }
if now.After(cert.NotAfter) { if now.After(cert.NotAfter) {
reasons.WriteString(fmt.Sprintf("Cert [%d] is expired", index + 1))
continue continue
} }
if err := cert.VerifyHostname(host); err != nil { if err := cert.VerifyHostname(host); err != nil {
reasons.WriteString(fmt.Sprintf("Cert [%d] hostname does not match", index + 1))
continue continue
} }
@ -118,7 +125,7 @@ func (t *TofuDigest) newCert(host string, cState *tls.ConnectionState) error {
return nil return nil
} }
return fmt.Errorf("No valid certificates were offered by host %q", host) return fmt.Errorf(reasons.String())
} }
func (t *TofuDigest) IniDump() string { func (t *TofuDigest) IniDump() string {