Merge pull request #2 from joshlf/stealchain-server
cmd/stealchain-server: Explicitly perform TLS handshake.
This commit is contained in:
commit
be34ad263d
|
@ -55,6 +55,11 @@ func main() {
|
|||
|
||||
raddr := conn.RemoteAddr()
|
||||
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()
|
||||
if len(cs.PeerCertificates) == 0 {
|
||||
fmt.Printf("[+] %v: no chain presented\n", raddr)
|
||||
|
|
Loading…
Reference in New Issue