summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/gorilla/websocket/tls_handshake_116.go
blob: e1b2b44f6e6c8cb3a188dfa8f9db6fe3253b262f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//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
}