Skip to content

Commit e8735a3

Browse files
committed
proxy: Add fallback to x509.NewCertPool() on Windows
On Windows, x509.SystemCertPool returns an error: golang/go#16736 This commit reverts to the behaviour before commit b50dc99 when catching such an error. This means https_proxy=https://... will be broken for non-mitm https proxies. Such proxies were not usable before the PR adding b50dc99, so this should not have much impact for our existing users. These CAs are used: - when accessing telemetry - when checking for a new crc version - when downloading binaries (only happens with git builds) This fixes crc-org#2770
1 parent 3cfaa10 commit e8735a3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/crc/network/proxy.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,8 @@ func (p *ProxyConfig) tlsConfig() (*tls.Config, error) {
210210
}
211211
caCertPool, err := x509.SystemCertPool()
212212
if err != nil {
213-
return nil, err
213+
logging.Warnf("Could not load system CA pool")
214+
caCertPool = x509.NewCertPool()
214215
}
215216
ok := caCertPool.AppendCertsFromPEM([]byte(p.ProxyCACert))
216217
if !ok {

0 commit comments

Comments
 (0)