summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authortjpcc <tjp@ctrl-c.club>2023-05-03 19:37:26 -0600
committertjpcc <tjp@ctrl-c.club>2023-05-03 19:50:56 -0600
commit91218665d27e39ccf799fdd4c6f7c8bb8e4ca4cf (patch)
tree9e2fdbd7c7a48041411d8f229513e92bee9039b9 /examples
parent5c9655a1bb2af0f23ca6d9daf96aed44cd01c3c8 (diff)
use sha256 for client cert fingerprints, and log them when available
Diffstat (limited to 'examples')
-rw-r--r--examples/inspectls/main.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/inspectls/main.go b/examples/inspectls/main.go
index 5becb71..d400fe9 100644
--- a/examples/inspectls/main.go
+++ b/examples/inspectls/main.go
@@ -3,7 +3,7 @@ package main
import (
"bytes"
"context"
- "crypto/md5"
+ "crypto/sha256"
"crypto/tls"
"crypto/x509"
"encoding/hex"
@@ -88,7 +88,7 @@ func displayTLSState(state *tls.ConnectionState) string {
}
func fingerprint(cert *x509.Certificate) []byte {
- raw := md5.Sum(cert.Raw)
+ raw := sha256.Sum256(cert.Raw)
dst := make([]byte, hex.EncodedLen(len(raw)))
hex.Encode(dst, raw[:])
return dst