refactor(netxlite): add factories to create TLS handshakers (#460)
See https://github.com/ooni/probe/issues/1591
This commit is contained in:
parent
6a1e92cace
commit
5b8df394b1
5 changed files with 61 additions and 3 deletions
|
|
@ -124,6 +124,15 @@ type TLSHandshaker interface {
|
|||
net.Conn, tls.ConnectionState, error)
|
||||
}
|
||||
|
||||
// NewTLSHandshakerStdlib creates a new TLS handshaker using the
|
||||
// go standard library to create TLS connections.
|
||||
func NewTLSHandshakerStdlib(logger Logger) TLSHandshaker {
|
||||
return &tlsHandshakerLogger{
|
||||
TLSHandshaker: &tlsHandshakerConfigurable{},
|
||||
Logger: logger,
|
||||
}
|
||||
}
|
||||
|
||||
// tlsHandshakerConfigurable is a configurable TLS handshaker that
|
||||
// uses by default the standard library's TLS implementation.
|
||||
type tlsHandshakerConfigurable struct {
|
||||
|
|
|
|||
Loading…
Reference in a new issue