TUN-3546: Fix panic in tlsconfig.LoadOriginCA
This commit is contained in:
parent
ae4f687754
commit
6159cb536f
|
@ -43,7 +43,7 @@ func (o *unixSocketPath) String() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *unixSocketPath) start(wg *sync.WaitGroup, log logger.Service, shutdownC <-chan struct{}, errC chan error, cfg OriginRequestConfig) error {
|
func (o *unixSocketPath) start(wg *sync.WaitGroup, log logger.Service, shutdownC <-chan struct{}, errC chan error, cfg OriginRequestConfig) error {
|
||||||
transport, err := newHTTPTransport(o, cfg)
|
transport, err := newHTTPTransport(o, cfg, log)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -89,7 +89,7 @@ func (o *localService) address() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *localService) start(wg *sync.WaitGroup, log logger.Service, shutdownC <-chan struct{}, errC chan error, cfg OriginRequestConfig) error {
|
func (o *localService) start(wg *sync.WaitGroup, log logger.Service, shutdownC <-chan struct{}, errC chan error, cfg OriginRequestConfig) error {
|
||||||
transport, err := newHTTPTransport(o, cfg)
|
transport, err := newHTTPTransport(o, cfg, log)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -198,7 +198,7 @@ func (o *helloWorld) String() string {
|
||||||
|
|
||||||
// Start starts a HelloWorld server and stores its address in the Service receiver.
|
// Start starts a HelloWorld server and stores its address in the Service receiver.
|
||||||
func (o *helloWorld) start(wg *sync.WaitGroup, log logger.Service, shutdownC <-chan struct{}, errC chan error, cfg OriginRequestConfig) error {
|
func (o *helloWorld) start(wg *sync.WaitGroup, log logger.Service, shutdownC <-chan struct{}, errC chan error, cfg OriginRequestConfig) error {
|
||||||
transport, err := newHTTPTransport(o, cfg)
|
transport, err := newHTTPTransport(o, cfg, log)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -274,8 +274,8 @@ func (nrc *NopReadCloser) Close() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func newHTTPTransport(service OriginService, cfg OriginRequestConfig) (*http.Transport, error) {
|
func newHTTPTransport(service OriginService, cfg OriginRequestConfig, log logger.Service) (*http.Transport, error) {
|
||||||
originCertPool, err := tlsconfig.LoadOriginCA(cfg.CAPool, nil)
|
originCertPool, err := tlsconfig.LoadOriginCA(cfg.CAPool, log)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "Error loading cert pool")
|
return nil, errors.Wrap(err, "Error loading cert pool")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue