review feedback

This commit is contained in:
Quentin McGaw
2026-06-05 05:01:18 +00:00
parent c18c54c3b7
commit b48ba8cb0a
2 changed files with 14 additions and 2 deletions
+12 -1
View File
@@ -69,12 +69,23 @@ func newHTTPSClient(destinationTLSName string, connection net.Conn) *http.Client
httpTransport.Proxy = nil
httpTransport.MaxIdleConns = 1
httpTransport.MaxIdleConnsPerHost = 1
httpTransport.MaxConnsPerHost = 1
httpTransport.IdleConnTimeout = time.Second
httpTransport.TLSClientConfig = &tls.Config{
MinVersion: tls.VersionTLS12,
ServerName: destinationTLSName,
}
httpTransport.DialContext = func(_ context.Context, _, _ string) (net.Conn, error) {
expectedAddress := net.JoinHostPort(destinationTLSName, "443")
httpTransport.DialContext = func(_ context.Context, network, address string) (net.Conn, error) {
switch network {
case "tcp", "tcp4", "tcp6":
default:
return nil, fmt.Errorf("unexpected dial network %q", network)
}
if address != expectedAddress {
return nil, fmt.Errorf("unexpected dial address %q (expected %q)", address, expectedAddress)
}
return connection, nil
}