cleanup(netx): remove redundant config options (#791)

Part of https://github.com/ooni/probe/issues/2121
This commit is contained in:
Simone Basso 2022-06-02 18:18:49 +02:00 committed by GitHub
commit 76b65893a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 54 additions and 162 deletions

View file

@ -41,15 +41,11 @@ func (c Configurer) NewConfiguration() (Configuration, error) {
HTTPConfig: netx.Config{
BogonIsError: c.Config.RejectDNSBogons,
CacheResolutions: true,
CertPool: c.Config.CertPool,
ContextByteCounting: true,
DialSaver: c.Saver,
HTTP3Enabled: c.Config.HTTP3Enabled,
HTTPSaver: c.Saver,
Logger: c.Logger,
ReadWriteSaver: c.Saver,
ResolveSaver: c.Saver,
TLSSaver: c.Saver,
Saver: c.Saver,
},
}
// fill DNS cache
@ -96,7 +92,8 @@ func (c Configurer) NewConfiguration() (Configuration, error) {
if err != nil {
return configuration, err
}
configuration.HTTPConfig.NoTLSVerify = c.Config.NoTLSVerify
configuration.HTTPConfig.TLSConfig.InsecureSkipVerify = c.Config.NoTLSVerify
configuration.HTTPConfig.TLSConfig.RootCAs = c.Config.CertPool
// configure proxy
configuration.HTTPConfig.ProxyURL = c.ProxyURL
return configuration, nil