File
Blob: tun/client/dialer/pki.go
| 1 | package dialer |
| 2 | |
| 3 | import ( |
| 4 | "crypto/tls" |
| 5 | "fmt" |
| 6 | "net/http" |
| 7 | |
| 8 | "go.miragespace.co/specter/spec/protocol" |
| 9 | ) |
| 10 | |
| 11 | func GetPKIClient(cfg *tls.Config, apex *ParsedApex) protocol.PKIService { |
| 12 | t := http.DefaultTransport.(*http.Transport).Clone() |
| 13 | cfg.NextProtos = nil |
| 14 | t.TLSClientConfig = cfg |
| 15 | t.DisableKeepAlives = true |
| 16 | t.MaxConnsPerHost = -1 |
| 17 | return protocol.NewPKIServiceProtobufClient(fmt.Sprintf("https://%s", apex.String()), &http.Client{ |
| 18 | Transport: t, |
| 19 | }) |
| 20 | } |