diff --git a/br/pkg/lightning/backend/local/local.go b/br/pkg/lightning/backend/local/local.go index 6afb1339ef422..099404c48479c 100644 --- a/br/pkg/lightning/backend/local/local.go +++ b/br/pkg/lightning/backend/local/local.go @@ -60,7 +60,6 @@ import ( "github.com/pingcap/tidb/pkg/tablecodec" "github.com/pingcap/tidb/pkg/util/codec" "github.com/pingcap/tidb/pkg/util/engine" - "github.com/pingcap/tidb/pkg/util/intest" "github.com/tikv/client-go/v2/oracle" tikvclient "github.com/tikv/client-go/v2/tikv" pd "github.com/tikv/pd/client" @@ -949,13 +948,7 @@ func (local *Backend) CloseEngine(ctx context.Context, cfg *backend.EngineConfig if err != nil { return err } - opts := &storage.ExternalStorageOptions{ - DisableSSL: true, - } - if intest.InTest { - opts.NoCredentials = true - } - store, err := storage.New(ctx, storeBackend, opts) + store, err := storage.NewWithDefaultOpt(ctx, storeBackend) if err != nil { return err } diff --git a/br/pkg/storage/ks3.go b/br/pkg/storage/ks3.go index abd42e09b5eb9..798340c21f244 100644 --- a/br/pkg/storage/ks3.go +++ b/br/pkg/storage/ks3.go @@ -63,7 +63,6 @@ func NewKS3Storage( return nil, errors.New("ks3 region is empty") } awsConfig.Region = qs.Region - awsConfig.DisableSSL = opts.DisableSSL if qs.Endpoint != "" { awsConfig.Endpoint = qs.Endpoint diff --git a/br/pkg/storage/s3.go b/br/pkg/storage/s3.go index 47be9665fb3e2..97f58ec5b89fd 100644 --- a/br/pkg/storage/s3.go +++ b/br/pkg/storage/s3.go @@ -305,7 +305,6 @@ func NewS3Storage(ctx context.Context, backend *backuppb.S3, opts *ExternalStora } else { awsConfig.WithRegion(qs.Region) } - awsConfig.DisableSSL = aws.Bool(opts.DisableSSL) if opts.S3Retryer != nil { request.WithRetryer(awsConfig, opts.S3Retryer) diff --git a/br/pkg/storage/storage.go b/br/pkg/storage/storage.go index 9fdac1194e490..0abecc827414c 100644 --- a/br/pkg/storage/storage.go +++ b/br/pkg/storage/storage.go @@ -174,10 +174,6 @@ type ExternalStorageOptions struct { // CheckObjectLockOptions check the s3 bucket has enabled the ObjectLock. // if enabled. it will send the options to tikv. CheckS3ObjectLockOptions bool - - // DisableSSL disable the SSL when connect to the remote storage. Currently - // only S3 is supported. - DisableSSL bool } // Create creates ExternalStorage. diff --git a/pkg/ddl/backfilling_merge_sort.go b/pkg/ddl/backfilling_merge_sort.go index 452e1d921b7ac..32d27d7146a06 100644 --- a/pkg/ddl/backfilling_merge_sort.go +++ b/pkg/ddl/backfilling_merge_sort.go @@ -89,9 +89,7 @@ func (m *mergeSortExecutor) RunSubtask(ctx context.Context, subtask *proto.Subta if err != nil { return err } - opt := &storage.ExternalStorageOptions{ - DisableSSL: true, - } + opt := &storage.ExternalStorageOptions{} if intest.InTest { opt.NoCredentials = true } diff --git a/pkg/ddl/backfilling_operators.go b/pkg/ddl/backfilling_operators.go index 5a2e8b2bf713d..75ced7ca4831e 100644 --- a/pkg/ddl/backfilling_operators.go +++ b/pkg/ddl/backfilling_operators.go @@ -46,7 +46,6 @@ import ( "github.com/pingcap/tidb/pkg/tablecodec" tidbutil "github.com/pingcap/tidb/pkg/util" "github.com/pingcap/tidb/pkg/util/chunk" - "github.com/pingcap/tidb/pkg/util/intest" "github.com/pingcap/tidb/pkg/util/logutil" "github.com/pingcap/tidb/pkg/util/memory" "github.com/prometheus/client_golang/prometheus" @@ -193,13 +192,7 @@ func NewWriteIndexToExternalStoragePipeline( if err != nil { return nil, err } - opts := &storage.ExternalStorageOptions{ - DisableSSL: true, - } - if intest.InTest { - opts.NoCredentials = true - } - extStore, err := storage.New(ctx, backend, opts) + extStore, err := storage.NewWithDefaultOpt(ctx, backend) if err != nil { return nil, err } diff --git a/pkg/executor/importer/import.go b/pkg/executor/importer/import.go index 98724a2a7a097..2dd931e828658 100644 --- a/pkg/executor/importer/import.go +++ b/pkg/executor/importer/import.go @@ -931,7 +931,7 @@ func (e *LoadDataController) InitDataStore(ctx context.Context) error { return exeerrors.ErrLoadDataInvalidURI.GenWithStackByArgs(target, err3.Error()) } - s, err = e.initSelfManagedExternalStore(ctx, cloudStorageURL, target) + s, err = e.initExternalStore(ctx, cloudStorageURL, target) if err != nil { return err } @@ -939,26 +939,6 @@ func (e *LoadDataController) InitDataStore(ctx context.Context) error { } return nil } - -func (*LoadDataController) initSelfManagedExternalStore(ctx context.Context, u *url.URL, target string) (storage.ExternalStorage, error) { - b, err2 := storage.ParseBackendFromURL(u, nil) - if err2 != nil { - return nil, exeerrors.ErrLoadDataInvalidURI.GenWithStackByArgs(target, GetMsgFromBRError(err2)) - } - - opt := &storage.ExternalStorageOptions{ - DisableSSL: true, - } - if intest.InTest { - opt.NoCredentials = true - } - s, err := storage.New(ctx, b, opt) - if err != nil { - return nil, exeerrors.ErrLoadDataCantAccess.GenWithStackByArgs(target, GetMsgFromBRError(err)) - } - return s, nil -} - func (*LoadDataController) initExternalStore(ctx context.Context, u *url.URL, target string) (storage.ExternalStorage, error) { b, err2 := storage.ParseBackendFromURL(u, nil) if err2 != nil {