cmd/stealchain-server: Explicitly perform TLS handshake.

This commit is contained in:
Joshua Liebow-Feeser 2017-08-29 09:53:51 -07:00
parent 68e5822176
commit 48b03c908d
1 changed files with 5 additions and 0 deletions

View File

@ -55,6 +55,11 @@ func main() {
raddr := conn.RemoteAddr() raddr := conn.RemoteAddr()
tconn := tls.Server(conn, cfg) tconn := tls.Server(conn, cfg)
err = tconn.Handshake()
if err != nil {
fmt.Printf("[+] %v: failed to complete handshake: %v\n", raddr, err)
continue
}
cs := tconn.ConnectionState() cs := tconn.ConnectionState()
if len(cs.PeerCertificates) == 0 { if len(cs.PeerCertificates) == 0 {
fmt.Printf("[+] %v: no chain presented\n", raddr) fmt.Printf("[+] %v: no chain presented\n", raddr)