Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http_proxy: unexport HTTPProxy.TLSConfig field #613

Merged
merged 1 commit into from
Dec 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions http_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ type HTTPProxy struct {
proxy *martian.Proxy
mitmCACert *x509.Certificate
proxyFunc ProxyFunc
listener net.Listener

TLSConfig *tls.Config
tlsConfig *tls.Config
listener net.Listener
}

// NewHTTPProxy creates a new HTTP proxy.
Expand Down Expand Up @@ -224,9 +224,9 @@ func (hp *HTTPProxy) configureHTTPS() error {
hp.log.Debugf("loading TLS certificate from %s and %s", hp.config.CertFile, hp.config.KeyFile)
}

hp.TLSConfig = httpsTLSConfigTemplate()
hp.tlsConfig = httpsTLSConfigTemplate()

return hp.config.ConfigureTLSConfig(hp.TLSConfig)
return hp.config.ConfigureTLSConfig(hp.tlsConfig)
}

func (hp *HTTPProxy) configureProxy() error {
Expand Down Expand Up @@ -615,7 +615,7 @@ func (hp *HTTPProxy) listen() (net.Listener, error) {
case HTTPScheme:
return listener, nil
case HTTPSScheme, HTTP2Scheme:
return tls.NewListener(listener, hp.TLSConfig), nil
return tls.NewListener(listener, hp.tlsConfig), nil
default:
listener.Close()
return nil, fmt.Errorf("invalid protocol %q", hp.config.Protocol)
Expand Down