MCPcopy
hub / github.com/AdguardTeam/dnsproxy / initTLSConfig

Method initTLSConfig

internal/cmd/proxy.go:329–341  ·  view source on GitHub ↗

initTLSConfig inits the TLS config.

(config *proxy.Config)

Source from the content-addressed store, hash-verified

327
328// initTLSConfig inits the TLS config.
329func (conf *configuration) initTLSConfig(config *proxy.Config) (err error) {
330 if conf.TLSCertPath != "" && conf.TLSKeyPath != "" {
331 var tlsConfig *tls.Config
332 tlsConfig, err = newTLSConfig(conf)
333 if err != nil {
334 return fmt.Errorf("loading TLS config: %w", err)
335 }
336
337 config.TLSConfig = tlsConfig
338 }
339
340 return nil
341}
342
343// initDNSCryptConfig inits the DNSCrypt config. config must not be nil.
344func (conf *configuration) initDNSCryptConfig(config *proxy.Config) (err error) {

Callers 1

createProxyConfigFunction · 0.80

Calls 1

newTLSConfigFunction · 0.70

Tested by

no test coverage detected