summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/gorilla/websocket/tls_handshake.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2022-03-12 19:41:07 +0100
committerGitHub <noreply@github.com>2022-03-12 19:41:07 +0100
commitb3be2e208cb373207d6199cac5a9fc92be073e7a (patch)
tree6de6d444737edee8f0476eea87c233fa980f0002 /vendor/github.com/gorilla/websocket/tls_handshake.go
parentc30e90ff3f7e9ff96ac79ed4b7d90d6346216a15 (diff)
downloadmatterbridge-msglm-b3be2e208cb373207d6199cac5a9fc92be073e7a.tar.gz
matterbridge-msglm-b3be2e208cb373207d6199cac5a9fc92be073e7a.tar.bz2
matterbridge-msglm-b3be2e208cb373207d6199cac5a9fc92be073e7a.zip
Update dependencies and vendor (#1761)
Diffstat (limited to 'vendor/github.com/gorilla/websocket/tls_handshake.go')
-rw-r--r--vendor/github.com/gorilla/websocket/tls_handshake.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/vendor/github.com/gorilla/websocket/tls_handshake.go b/vendor/github.com/gorilla/websocket/tls_handshake.go
new file mode 100644
index 00000000..a62b68cc
--- /dev/null
+++ b/vendor/github.com/gorilla/websocket/tls_handshake.go
@@ -0,0 +1,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.HandshakeContext(ctx); err != nil {
+ return err
+ }
+ if !cfg.InsecureSkipVerify {
+ if err := tlsConn.VerifyHostname(cfg.ServerName); err != nil {
+ return err
+ }
+ }
+ return nil
+}