All Downloads are FREE. Search and download functionalities are using the official Maven repository.

vendor.github.com.gorilla.websocket.tls_handshake.go Maven / Gradle / Ivy

The newest version!
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
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy