MCPcopy Create free account
hub / github.com/cloudflare/cfssl / getInfoFromRemote

Function getInfoFromRemote

cli/info/info.go:30–56  ·  view source on GitHub ↗
(c cli.Config)

Source from the content-addressed store, hash-verified

28var infoFlags = []string{"remote", "label", "profile", "config"}
29
30func getInfoFromRemote(c cli.Config) (resp *info.Resp, err error) {
31 req := new(info.Req)
32 req.Label = c.Label
33 req.Profile = c.Profile
34
35 cert, err := helpers.LoadClientCertificate(c.MutualTLSCertFile, c.MutualTLSKeyFile)
36 if err != nil {
37 return
38 }
39 remoteCAs, err := helpers.LoadPEMCertPool(c.TLSRemoteCAs)
40 if err != nil {
41 return
42 }
43 serv := client.NewServerTLS(c.Remote, helpers.CreateTLSConfig(remoteCAs, cert))
44 reqJSON, _ := json.Marshal(req)
45 resp, err = serv.Info(reqJSON)
46 if err != nil {
47 return
48 }
49
50 _, err = helpers.ParseCertificatePEM([]byte(resp.Certificate))
51 if err != nil {
52 return
53 }
54
55 return
56}
57
58func getInfoFromConfig(c cli.Config) (resp *info.Resp, err error) {
59 s, err := sign.SignerFromConfig(c)

Callers 1

infoMainFunction · 0.85

Calls 6

LoadClientCertificateFunction · 0.92
LoadPEMCertPoolFunction · 0.92
NewServerTLSFunction · 0.92
CreateTLSConfigFunction · 0.92
ParseCertificatePEMFunction · 0.92
InfoMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…