mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
re-use transport and set stronger backwards compatible Ciphers (#19565)
This PR fixes a few things - FIPS support for missing for remote transports, causing MinIO could end up using non-FIPS Ciphers in FIPS mode - Avoids too many transports, they all do the same thing to make connection pooling work properly re-use them. - globalTCPOptions must be set before setting transport to make sure the client conn deadlines are honored properly. - GCS warm tier must re-use our transport - Re-enable trailing headers support.
This commit is contained in:
@@ -22,6 +22,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
|
||||
"cloud.google.com/go/storage"
|
||||
"github.com/minio/madmin-go/v3"
|
||||
@@ -102,7 +103,7 @@ func (gcs *warmBackendGCS) InUse(ctx context.Context) (bool, error) {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
func newWarmBackendGCS(conf madmin.TierGCS, _ string) (*warmBackendGCS, error) {
|
||||
func newWarmBackendGCS(conf madmin.TierGCS, tier string) (*warmBackendGCS, error) {
|
||||
// Validation code
|
||||
if conf.Creds == "" {
|
||||
return nil, errors.New("empty credentials unsupported")
|
||||
@@ -117,7 +118,16 @@ func newWarmBackendGCS(conf madmin.TierGCS, _ string) (*warmBackendGCS, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
client, err := storage.NewClient(context.Background(), option.WithCredentialsJSON(credsJSON), option.WithScopes(storage.ScopeReadWrite))
|
||||
clnt := &http.Client{
|
||||
Transport: globalRemoteTargetTransport,
|
||||
}
|
||||
|
||||
client, err := storage.NewClient(context.Background(),
|
||||
option.WithCredentialsJSON(credsJSON),
|
||||
option.WithScopes(storage.ScopeReadWrite),
|
||||
option.WithHTTPClient(clnt),
|
||||
option.WithUserAgent(fmt.Sprintf("gcs-tier-%s", tier)+SlashSeparator+ReleaseTag),
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user