MCPcopy
hub / github.com/cloudflare/cloudflared / FindDefaultOriginCertPath

Function FindDefaultOriginCertPath

credentials/origin_cert.go:48–56  ·  view source on GitHub ↗

FindDefaultOriginCertPath returns the first path that contains a cert.pem file. If none of the DefaultConfigSearchDirectories contains a cert.pem file, return empty string

()

Source from the content-addressed store, hash-verified

46// FindDefaultOriginCertPath returns the first path that contains a cert.pem file. If none of the
47// DefaultConfigSearchDirectories contains a cert.pem file, return empty string
48func FindDefaultOriginCertPath() string {
49 for _, defaultConfigDir := range config.DefaultConfigSearchDirectories() {
50 originCertPath, _ := homedir.Expand(filepath.Join(defaultConfigDir, DefaultCredentialFile))
51 if ok := fileExists(originCertPath); ok {
52 return originCertPath
53 }
54 }
55 return ""
56}
57
58func DecodeOriginCert(blocks []byte) (*OriginCert, error) {
59 return decodeOriginCert(blocks)

Callers 3

buildTokenSubcommandFunction · 0.92
buildTailCommandFunction · 0.92

Calls 2

fileExistsFunction · 0.85

Tested by

no test coverage detected