diff options
-rw-r--r-- | crtsh-pem2html.go | 10 | ||||
-rw-r--r-- | diff-pem2html.go | 6 | ||||
-rw-r--r-- | tls-getcerts.go | 10 | ||||
-rw-r--r-- | tls-pem2html.go | 11 |
4 files changed, 18 insertions, 19 deletions
diff --git a/crtsh-pem2html.go b/crtsh-pem2html.go index 66961b1..0bad106 100644 --- a/crtsh-pem2html.go +++ b/crtsh-pem2html.go @@ -28,10 +28,10 @@ func handleBool(ok bool, str string, a ...interface{}) { var tmpl = template.Must(template.New("pem2html"). Funcs(template.FuncMap{ - "red": red, - "green": green, - "date": fDate, - "datetime": fDateTime, + "red": red, + "green": green, + "date": fDate, + "datetime": fDateTime, "colorDatetime": cDateTime, }).Parse(`<table class=sortable> <caption> @@ -180,5 +180,5 @@ func main() { } sort.Sort(certs) - handleErr(tmpl.Execute(os.Stdout, map[string]interface{}{"certs":certs, "now": now}), "Could not execute template: %v\n") + handleErr(tmpl.Execute(os.Stdout, map[string]interface{}{"certs": certs, "now": now}), "Could not execute template: %v\n") } diff --git a/diff-pem2html.go b/diff-pem2html.go index 50c521b..542b829 100644 --- a/diff-pem2html.go +++ b/diff-pem2html.go @@ -46,7 +46,7 @@ type Cert struct { } func (cert Cert) Pfix() string { - return map[string]string { + return map[string]string{ "add": "+", "del": "-", "ctx": " ", @@ -97,8 +97,8 @@ func main() { } handleErr(tmpl.Execute(os.Stdout, map[string]interface{}{ - "certs":certs, - "nTLS": a, + "certs": certs, + "nTLS": a, "nCrtSh": b, }), "Could not execute template: %v\n") } diff --git a/tls-getcerts.go b/tls-getcerts.go index dfec7f8..d598d27 100644 --- a/tls-getcerts.go +++ b/tls-getcerts.go @@ -14,7 +14,7 @@ import ( ) type xmppStreamsFeatures struct { - XMLName xml.Name `xml:"http://etherx.jabber.org/streams features"` + XMLName xml.Name `xml:"http://etherx.jabber.org/streams features"` } type xmppTlsProceed struct { @@ -62,7 +62,7 @@ func xmppStartTLS(connRaw net.Conn, host string) error { return nil } -func getcert(socket string) (*x509.Certificate, error){ +func getcert(socket string) (*x509.Certificate, error) { u, err := url.Parse(socket) if err != nil { return nil, err @@ -99,7 +99,7 @@ func getcert(socket string) (*x509.Certificate, error){ cstate := connTLS.ConnectionState() opts := x509.VerifyOptions{ - DNSName: host, + DNSName: host, Intermediates: x509.NewCertPool(), } for _, cert := range cstate.PeerCertificates[1:] { @@ -122,9 +122,9 @@ func split(socket string) (net, addr string) { func main() { for _, socket := range os.Args[1:] { block := pem.Block{ - Type: "CERTIFICATE", + Type: "CERTIFICATE", Headers: map[string]string{"X-Socket": socket}, - Bytes: nil, + Bytes: nil, } cert, err := getcert(socket) if cert != nil { diff --git a/tls-pem2html.go b/tls-pem2html.go index 4861787..d339fc5 100644 --- a/tls-pem2html.go +++ b/tls-pem2html.go @@ -28,10 +28,10 @@ func handleBool(ok bool, str string, a ...interface{}) { var tmpl = template.Must(template.New("pem2html"). Funcs(template.FuncMap{ - "red": red, - "green": green, - "date": fDate, - "datetime": fDateTime, + "red": red, + "green": green, + "date": fDate, + "datetime": fDateTime, "colorDatetime": cDateTime, }).Parse(`<table class=sortable> <caption> @@ -141,7 +141,6 @@ func (cert Cert) Class() string { } } - type Certs []Cert // Len is the number of elements in the collection. @@ -188,5 +187,5 @@ func main() { } sort.Sort(certs) - handleErr(tmpl.Execute(os.Stdout, map[string]interface{}{"certs":certs, "now": now}), "Could not execute template: %v\n") + handleErr(tmpl.Execute(os.Stdout, map[string]interface{}{"certs": certs, "now": now}), "Could not execute template: %v\n") } |