// https://www.imperialviolet.org/2013/02/04/luckythirteen.html.
import (
- "bytes"
"crypto"
"crypto/ecdsa"
"crypto/rsa"
// The configuration config must be non-nil and must include
// at least one certificate or else set GetCertificate.
func Server(conn net.Conn, config *Config) *Conn {
- return &Conn{
- conn: conn, config: config,
- input: *bytes.NewReader(nil), // Issue 28269
- }
+ return &Conn{conn: conn, config: config}
}
// Client returns a new TLS client side connection
// The config cannot be nil: users must set either ServerName or
// InsecureSkipVerify in the config.
func Client(conn net.Conn, config *Config) *Conn {
- return &Conn{
- conn: conn, config: config, isClient: true,
- input: *bytes.NewReader(nil), // Issue 28269
- }
+ return &Conn{conn: conn, config: config, isClient: true}
}
// A listener implements a network listener (net.Listener) for TLS connections.