1
0
mirror of https://github.com/fumiama/terasu.git synced 2026-06-11 13:40:30 +08:00

optimize: api

This commit is contained in:
源文雨
2024-04-16 15:10:47 +09:00
parent dc4fb1ae72
commit 62d3c9f6be
5 changed files with 50 additions and 15 deletions

View File

@@ -29,10 +29,15 @@ func main() {
if err != nil {
return nil, err
}
return terasu.Use(tls.Client(conn, &tls.Config{
ServerName: host,
InsecureSkipVerify: true,
})), nil
tlsConn := tls.Client(conn, &tls.Config{
ServerName: host,
})
err = terasu.Use(tlsConn).Handshake()
if err != nil {
_ = tlsConn.Close()
return nil, err
}
return tlsConn, nil
},
},
}