certdump: only close connection if Dial succeeds.

This commit is contained in:
Kyle Isom 2016-10-14 09:54:04 -07:00
parent c8b627565f
commit 89bddc74bb
1 changed files with 1 additions and 1 deletions

View File

@ -240,10 +240,10 @@ func displayAllCertsWeb(uri string, leafOnly bool) {
if err == nil {
state = conn.ConnectionState()
}
conn.Close()
} else {
Warn(err, "TLS verification error with server name %s", ci.Host)
}
conn.Close()
if len(state.PeerCertificates) == 0 {
Warnx("no certificates found")