File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,14 @@ var versionSuffix = " (dev)"
5151var baseUserAgent = "go/" + runtime .Version () + " (" + runtime .GOOS + " " + runtime .GOARCH + ") azure-devops-go-api/" + version + versionSuffix
5252
5353func NewClient (connection * Connection , baseUrl string ) * Client {
54- client := & http.Client {}
54+ var client * http.Client
55+
56+ if connection .TlsConfig != nil {
57+ client = & http.Client {Transport : & http.Transport {TLSClientConfig : connection .TlsConfig }}
58+ } else {
59+ client = & http.Client {}
60+ }
61+
5562 if connection .Timeout != nil {
5663 client .Timeout = * connection .Timeout
5764 }
Original file line number Diff line number Diff line change @@ -5,11 +5,13 @@ package azuredevops
55
66import (
77 "context"
8+ "crypto/tls"
89 "encoding/base64"
9- "github.com/google/uuid"
1010 "strings"
1111 "sync"
1212 "time"
13+
14+ "github.com/google/uuid"
1315)
1416
1517// Creates a new Azure DevOps connection instance using a personal access token.
@@ -38,6 +40,7 @@ type Connection struct {
3840 SuppressFedAuthRedirect bool
3941 ForceMsaPassThrough bool
4042 Timeout * time.Duration
43+ TlsConfig * tls.Config
4144 clientCache map [string ]Client
4245 clientCacheLock sync.RWMutex
4346 resourceAreaCache map [uuid.UUID ]ResourceAreaInfo
You can’t perform that action at this time.
0 commit comments