5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-28 11:31:34 +00:00
matterbridge/vendor/github.com/gorilla/websocket/tls_handshake_116.go

22 lines
367 B
Go
Raw Normal View History

2022-03-12 18:41:07 +00:00
//go:build !go1.17
// +build !go1.17
package websocket
import (
"context"
"crypto/tls"
)
func doHandshake(ctx context.Context, tlsConn *tls.Conn, cfg *tls.Config) error {
if err := tlsConn.Handshake(); err != nil {
return err
}
if !cfg.InsecureSkipVerify {
if err := tlsConn.VerifyHostname(cfg.ServerName); err != nil {
return err
}
}
return nil
}