remove ServerName from tls.Config

This commit is contained in:
qowevisa 2024-02-25 03:54:35 +02:00
parent 0dfe50052e
commit c127b19d5a

View File

@ -29,7 +29,9 @@ func main() {
log.Fatalf("client: failed to parse root certificate")
}
config := &tls.Config{RootCAs: roots, ServerName: host}
config := &tls.Config{
RootCAs: roots,
}
conn, err := tls.Dial("tcp", fmt.Sprintf("%s:%d", host, port), config)
if err != nil {
log.Fatalf("client: dial: %s", err)