MCPcopy Index your code
hub / github.com/coder/coder / configureCAPool

Function configureCAPool

cli/server.go:2032–2045  ·  view source on GitHub ↗
(tlsClientCAFile string, tlsConfig *tls.Config)

Source from the content-addressed store, hash-verified

2030}
2031
2032func configureCAPool(tlsClientCAFile string, tlsConfig *tls.Config) error {
2033 if tlsClientCAFile != "" {
2034 caPool := x509.NewCertPool()
2035 data, err := os.ReadFile(tlsClientCAFile)
2036 if err != nil {
2037 return xerrors.Errorf("read %q: %w", tlsClientCAFile, err)
2038 }
2039 if !caPool.AppendCertsFromPEM(data) {
2040 return xerrors.Errorf("failed to parse CA certificate in tls-client-ca-file")
2041 }
2042 tlsConfig.ClientCAs = caPool
2043 }
2044 return nil
2045}
2046
2047const (
2048 // Client ID for https://github.com/apps/coder

Callers 2

configureServerTLSFunction · 0.85
ConfigureHTTPClientFunction · 0.85

Calls 2

ReadFileMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected