ooni-probe-cli/internal/engine/experiment/websteps/tls.go

17 lines
311 B
Go
Raw Normal View History

package websteps
import (
"crypto/tls"
"net"
)
// TLSDo performs the TLS check.
func TLSDo(conn net.Conn, hostname string) (*tls.Conn, error) {
tlsConn := tls.Client(conn, &tls.Config{
ServerName: hostname,
NextProtos: []string{"h2", "http/1.1"},
})
err := tlsConn.Handshake()
return tlsConn, err
}