mirror of
https://github.com/42wim/matterbridge.git
synced 2024-11-30 06:32:01 -08:00
22 lines
375 B
Go
22 lines
375 B
Go
//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.HandshakeContext(ctx); err != nil {
|
|
return err
|
|
}
|
|
if !cfg.InsecureSkipVerify {
|
|
if err := tlsConn.VerifyHostname(cfg.ServerName); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
return nil
|
|
}
|