Skip to content

Commit

Permalink
Print connection SSL/TLS version
Browse files Browse the repository at this point in the history
  • Loading branch information
dusansalestrekker committed Jul 23, 2021
1 parent 4f9c658 commit b0370b0
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,22 @@ func visit(url *url.URL) {
printf("\n%s\n", bodyMsg)
}

// Print SSL/TLS version which is used for connection
tlsVersion := ""
switch resp.TLS.Version {
case tls.VersionSSL30:
tlsVersion = "SSL v3"
case tls.VersionTLS10:
tlsVersion = "TLS v1.0"
case tls.VersionTLS11:
tlsVersion = "TLS v1.1"
case tls.VersionTLS12:
tlsVersion = "TLS v1.2"
case tls.VersionTLS13:
tlsVersion = "TLS v1.3"
}
printf("\n%s %s\n", color.GreenString("Connected via"), color.CyanString("%s", tlsVersion))

fmta := func(d time.Duration) string {
return color.CyanString("%7dms", int(d/time.Millisecond))
}
Expand Down

0 comments on commit b0370b0

Please sign in to comment.