robocar-steering/vendor/github.com/gorilla/websocket/tls_handshake.go

19 lines
339 B
Go
Raw Normal View History

2023-10-15 09:51:11 +00:00
package websocket
import (
"context"
"crypto/tls"
)
func doHandshake(ctx context.Context, tlsConn *tls.Conn, cfg *tls.Config) error {
if err := tlsConn.HandshakeContext(ctx); err != nil {
return err
}
if !cfg.InsecureSkipVerify {
if err := tlsConn.VerifyHostname(cfg.ServerName); err != nil {
return err
}
}
return nil
}