MCPcopy Create free account
hub / github.com/prometheus/common / NewTLSRoundTripper

Function NewTLSRoundTripper

config/http_config.go:1044–1066  ·  view source on GitHub ↗
(
	cfg *tls.Config,
	settings TLSRoundTripperSettings,
	newRT func(*tls.Config) (http.RoundTripper, error),
)

Source from the content-addressed store, hash-verified

1042}
1043
1044func NewTLSRoundTripper(
1045 cfg *tls.Config,
1046 settings TLSRoundTripperSettings,
1047 newRT func(*tls.Config) (http.RoundTripper, error),
1048) (http.RoundTripper, error) {
1049 t := &tlsRoundTripper{
1050 settings: settings,
1051 newRT: newRT,
1052 tlsConfig: cfg,
1053 }
1054
1055 rt, err := t.newRT(t.tlsConfig)
1056 if err != nil {
1057 return nil, err
1058 }
1059 t.rt = rt
1060 _, t.hashCAData, t.hashCertData, t.hashKeyData, err = t.getTLSDataWithHash()
1061 if err != nil {
1062 return nil, err
1063 }
1064
1065 return t, nil
1066}
1067
1068func (t *tlsRoundTripper) getTLSDataWithHash() ([]byte, []byte, []byte, []byte, error) {
1069 var (

Callers 2

RoundTripMethod · 0.85

Calls 1

getTLSDataWithHashMethod · 0.95

Tested by

no test coverage detected