File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -1101,6 +1101,8 @@ var AgentStartCommand = cli.Command{
11011101 l .Info ("Agents will disconnect after %d seconds of inactivity" , agentConf .DisconnectAfterIdleTimeout )
11021102 }
11031103
1104+ l .Info ("Using http client profile: %s" , cfg .HTTPClientProfile )
1105+
11041106 if len (cfg .AllowedRepositories ) > 0 {
11051107 agentConf .AllowedRepositories = make ([]* regexp.Regexp , 0 , len (cfg .AllowedRepositories ))
11061108 for _ , v := range cfg .AllowedRepositories {
Original file line number Diff line number Diff line change @@ -26,14 +26,23 @@ func NewClient(opts ...ClientOption) *http.Client {
2626 opt (& conf )
2727 }
2828
29+ // http client profile is used to switch between different http client implementations
30+ // - stdlib: uses the standard library http client
2931 switch conf .HTTPClientProfile {
3032 case "stdlib" :
33+ // Base any modifications on the default transport.
34+ transport := http .DefaultTransport .(* http.Transport ).Clone ()
35+
36+ if conf .TLSConfig != nil {
37+ transport .TLSClientConfig = conf .TLSConfig
38+ }
39+
3140 return & http.Client {
3241 Timeout : conf .Timeout ,
3342 Transport : & authenticatedTransport {
3443 Bearer : conf .Bearer ,
3544 Token : conf .Token ,
36- Delegate : http . DefaultTransport ,
45+ Delegate : transport ,
3746 },
3847 }
3948 }
You can’t perform that action at this time.
0 commit comments