上传自签署https minio

Test_HIR_Net8
hang 2025-04-03 16:20:59 +08:00
parent 4713d2a09b
commit eed17feae0
1 changed files with 6 additions and 0 deletions

View File

@ -223,11 +223,17 @@ public class OSSService : IOSSService
}
else if (ObjectStoreServiceOptions.ObjectStoreUse == "MinIO")
{
var httpClientHandler = new HttpClientHandler
{
ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator
};
var minIOConfig = ObjectStoreServiceOptions.MinIO;
var minioClient = new MinioClient().WithEndpoint($"{minIOConfig.EndPoint}:{minIOConfig.Port}")
.WithCredentials(minIOConfig.AccessKeyId, minIOConfig.SecretAccessKey).WithSSL(minIOConfig.UseSSL)
.WithHttpClient(new HttpClient(httpClientHandler))
.Build();
var putObjectArgs = new PutObjectArgs()