Documentation
¶
Overview ¶
Package tlsmiddlebox implements the tlsmiddlebox experiment
Spec: https://github.com/ooni/spec/blob/master/nettests/ts-037-tlsmiddlebox.md.
Index ¶
- Variables
- func LookupASN(ip string, dbPath string) (asn uint, org string, err error)
- func LookupCC(ip string, dbPath string) (cc string, err error)
- func NewDialerTTLWrapper() model.Dialer
- func NewLoader(loader *targetloading.Loader, gopts any) model.ExperimentTargetLoader
- type CompleteTrace
- type Config
- type ICMPIteration
- type Iteration
- type IterativeTrace
- type IterativeTraceroute
- type Measurer
- func (m *Measurer) DNSLookup(ctx context.Context, index int64, zeroTime time.Time, logger model.Logger, ...) ([]string, error)
- func (m *Measurer) ExperimentName() string
- func (m *Measurer) ExperimentVersion() string
- func (m *Measurer) Run(ctx context.Context, args *model.ExperimentArgs) error
- func (m *Measurer) TCPConnect(ctx context.Context, index int64, zeroTime time.Time, logger model.Logger, ...) error
- func (m *Measurer) TLSTrace(ctx context.Context, index int64, zeroTime time.Time, logger model.Logger, ...)
- func (m *Measurer) TraceAddress(ctx context.Context, index int64, zeroTime time.Time, logger model.Logger, ...) error
- type Target
- type TestKeys
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoInput indicates that no input was provided ErrNoInput = errors.New("no input provided") // ErrInputIsNotAnURL indicates that the input is not an URL. ErrInputIsNotAnURL = errors.New("input is not an URL") // ErrUnsupportedInput indicates that the input URL scheme is unsupported. ErrUnsupportedInput = errors.New("unsupported input scheme, input scheme must be https") // ErrInputRequired indicates that no richer-input target was provided. ErrInputRequired = targetloading.ErrInputRequired // ErrInvalidInputType indicates that the richer-input target has the wrong type. ErrInvalidInputType = targetloading.ErrInvalidInputType )
var ClientIDs = map[int]*utls.ClientHelloID{ 1: &utls.HelloGolang, 2: &utls.HelloChrome_Auto, 3: &utls.HelloFirefox_Auto, 4: &utls.HelloIOS_Auto, }
ClientIDs to map configurable inputs to uTLS fingerprints We use a non-zero index to map to each ClientID
Functions ¶
func NewDialerTTLWrapper ¶
NewDialerTTLWrapper returns a wrapped Dialer via dialerTTLWrapper
func NewLoader ¶ added in v0.37.0
func NewLoader(loader *targetloading.Loader, gopts any) model.ExperimentTargetLoader
NewLoader constructs a new model.ExperimentTargetLoader instance.
This function PANICS if options is not an instance of *tlsmiddlebox.Config.
Types ¶
type CompleteTrace ¶
type CompleteTrace struct {
Address string `json:"address"`
TCPTraceroute *IterativeTraceroute `json:"tcp_traceroute"`
ControlTrace *IterativeTrace `json:"control_trace"`
TargetTrace *IterativeTrace `json:"target_trace"`
}
CompleteTrace records the result of the network trace using a control SNI and a target SNI
type Config ¶
type Config struct {
// ResolverURL is the default DoH resolver
ResolverURL string `json:"resolver_url" ooni:"URL for DoH resolver"`
// SNIPass is the SNI value we don't expect to be blocked
SNIControl string `json:"sni_control" ooni:"control SNI value for testhelper"`
// Delay is the delay between each iteration (in milliseconds).
Delay int64 `json:"delay" ooni:"delay between consecutive iterations"`
// MaxTTL is the default number of interations we trace
MaxTTL int64 `json:"maximum_ttl" ooni:"maximum TTL value to iterate upto"`
// TestHelper is the testhelper host for iterative tracing
TestHelper string `json:"test_helper" ooni:"testhelper URL to use for tracing"`
// ClientId is the client fingerprint to use
ClientId int64 `json:"client_id" ooni:"ClientHello fingerprint to use"`
// PrivacyMode is whether the user only wants to reveal AS and country information or city-level geolocation and /24 prefix information with respect to traceroutes
PrivacyMode string `json:"privacy_mode" ooni:"privacy mode to use for traceroutes"`
}
Config contains the experiment configuration.
type ICMPIteration ¶ added in v0.37.0
type ICMPIteration struct {
TTL int `json:"ttl"`
ICMPError *model.ArchivalICMPErrorMessage `json:"icmp_error"`
}
ICMPIteration is a single ICMP error message associated with a TTL-limited probe when used for traceroute
type Iteration ¶
type Iteration struct {
TTL int `json:"ttl"`
Handshake *model.ArchivalTLSOrQUICHandshakeResult `json:"handshake"`
}
Iteration is a single network iteration with variable TTL
type IterativeTrace ¶
type IterativeTrace struct {
SNI string `json:"server_name"`
Iterations []*Iteration `json:"iterations"`
// contains filtered or unexported fields
}
Trace is an iterative trace for the corresponding servername and address
type IterativeTraceroute ¶ added in v0.37.0
type IterativeTraceroute struct {
SNI string `json:"server_name"`
Iterations []*ICMPIteration `json:"iterations"`
// contains filtered or unexported fields
}
IterativeTraceroute is an iterative traceroute towards the address
type Measurer ¶
type Measurer struct {
// contains filtered or unexported fields
}
Measurer performs the measurement.
func NewExperimentMeasurer ¶
func NewExperimentMeasurer() *Measurer
NewExperimentMeasurer creates a new ExperimentMeasurer.
func (*Measurer) DNSLookup ¶
func (m *Measurer) DNSLookup(ctx context.Context, index int64, zeroTime time.Time, logger model.Logger, domain string, tk *TestKeys, config *Config) ([]string, error)
DNSLookup performs a DNS Lookup for the passed domain
func (*Measurer) ExperimentName ¶
ExperimentName implements ExperimentMeasurer.ExperimentName.
func (*Measurer) ExperimentVersion ¶
ExperimentVersion implements ExperimentMeasurer.ExperimentVersion.
func (*Measurer) TCPConnect ¶
func (m *Measurer) TCPConnect(ctx context.Context, index int64, zeroTime time.Time, logger model.Logger, address string, tk *TestKeys) error
TCPConnect performs a TCP connect to filter working addresses
type Target ¶ added in v0.37.0
type Target struct {
// Config contains the configuration.
Config *Config
// URL is the input URL.
URL string
// contains filtered or unexported fields
}
Target is a richer-input target that this experiment should measure.
func (*Target) Category ¶ added in v0.37.0
Category implements model.ExperimentTarget.
func (*Target) Country ¶ added in v0.37.0
Country implements model.ExperimentTarget.
func (*Target) Input ¶ added in v0.37.0
Input implements model.ExperimentTarget.
func (*Target) Options ¶ added in v0.37.0
Options implements model.ExperimentTarget.
func (*Target) String ¶ added in v0.37.0
String implements model.ExperimentTarget.
type TestKeys ¶
type TestKeys struct {
Queries []*model.ArchivalDNSLookupResult `json:"queries"`
TCPConnect []*model.ArchivalTCPConnectResult `json:"tcp_connect"`
IterativeTrace []*CompleteTrace `json:"iterative_trace"`
// contains filtered or unexported fields
}
TestKeys contains the experiment results