Initial client server connection using TLS

This commit is contained in:
Dustin Pianalto
2020-10-22 00:30:59 -08:00
parent 2d96eb55e1
commit 9c6fe7d3e4
5 changed files with 119 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
package main
import (
"crypto/tls"
"log"
)
func main() {
config := &tls.Config{
MinVersion: tls.VersionTLS12,
InsecureSkipVerify: true,
}
conn, err := tls.Dial("tcp4", "localhost:1965", config)
if err != nil {
log.Fatal(err)
}
n, err := conn.Write([]byte("Test message"))
if err != nil {
log.Fatal(err)
}
log.Println(n)
}