Created
September 4, 2015 20:01
-
-
Save ghaskins/5f9758d7e8cb48bf1f7d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var conn *tls.Conn | |
if conn, err = tls.Dial("tcp", "10.20.30.215:2000", config); err != nil { | |
panic("failed to connect: " + err.Error()) | |
} | |
defer conn.Close() | |
certs := conn.ConnectionState().PeerCertificates | |
if len(certs) != 1 { | |
log.Panicf("Connected with too many (%d) certificates presented\n", len(certs)) | |
} | |
cert := certs[0] | |
if err = cert.CheckSignature(cert.SignatureAlgorithm, cert.RawTBSCertificate, cert.Signature); err != nil { | |
log.Panicln(err) | |
} | |
fmt.Println("Connected") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment