open-horizon / anax

Horizon agent control system
https://open-horizon.github.io/docs/anax/docs/
Apache License 2.0
70 stars 99 forks source link

Enable hzn CLI to trust system CAs like the agent can #4099

Open dlarson04 opened 3 days ago

dlarson04 commented 3 days ago

Describe the bug.

Currently, the anax agent has this code to trust system CAs

var err error
certPool, err = x509.SystemCertPool()

 certPool.AppendCertsFromPEM(mgmtHubBytes)

but in cli/cliutils/cliutils.go just has

caCertPool := x509.NewCertPool()
caCertPool.AppendCertsFromPEM(icpCert)

so it doesn't trust system CAs

This caused a problem for a OH implementation

HZN CLI should also be able to trust system CAs

Describe the steps to reproduce the behavior.

No response

Expected behavior.

No response

Screenshots.

No response

Operating Environment

Linux

Additional Information

No response