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

Method SetOriginServerName

ingress/origin_proxy.go:61–73  ·  view source on GitHub ↗
(req *http.Request)

Source from the content-addressed store, hash-verified

59}
60
61func (o *httpService) SetOriginServerName(req *http.Request) {
62 o.transport.DialTLSContext = func(ctx context.Context, network, addr string) (net.Conn, error) {
63 conn, err := o.transport.DialContext(ctx, network, addr)
64 if err != nil {
65 return nil, err
66 }
67 return tls.Client(conn, &tls.Config{
68 RootCAs: o.transport.TLSClientConfig.RootCAs,
69 InsecureSkipVerify: o.transport.TLSClientConfig.InsecureSkipVerify, // nolint: gosec
70 ServerName: req.Host,
71 }), nil
72 }
73}
74
75func (o *statusCode) RoundTrip(_ *http.Request) (*http.Response, error) {
76 if o.defaultResp {

Callers 1

RoundTripMethod · 0.95

Calls 2

DialContextMethod · 0.65
ClientMethod · 0.45

Tested by

no test coverage detected