From dc1f95c75eb11d50f61f85b18d518aff2513cfe7 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 5 Jun 2026 17:50:32 +0800 Subject: [PATCH] =?UTF-8?q?minio=20=E8=8E=B7=E5=8F=96=E6=B5=81=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Helper/OSSService.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/IRaCIS.Core.Application/Helper/OSSService.cs b/IRaCIS.Core.Application/Helper/OSSService.cs index ec04c3f08..417b9b5b4 100644 --- a/IRaCIS.Core.Application/Helper/OSSService.cs +++ b/IRaCIS.Core.Application/Helper/OSSService.cs @@ -1186,14 +1186,21 @@ public class OSSService(IOptionsMonitor options, } 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 pipe = new System.IO.Pipelines.Pipe(); _ = Task.Run(async () => @@ -1206,6 +1213,7 @@ public class OSSService(IOptionsMonitor options, .WithCallbackStream(stream => { stream.CopyTo(pipe.Writer.AsStream()); + pipe.Writer.FlushAsync(); }); await minioClient.GetObjectAsync(args); @@ -1213,6 +1221,7 @@ public class OSSService(IOptionsMonitor options, } catch (Exception ex) { + Log.Error($"minio 获取流错误:{ex.Message}"); await pipe.Writer.CompleteAsync(ex); } });