cmd/stealchain-server: Explicitly perform TLS handshake.
This commit is contained in:
parent
68e5822176
commit
48b03c908d
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue