diff --git a/src/main/java/run/halo/app/handler/file/MinioFileHandler.java b/src/main/java/run/halo/app/handler/file/MinioFileHandler.java index 43483d8a7f..389f9b92ac 100644 --- a/src/main/java/run/halo/app/handler/file/MinioFileHandler.java +++ b/src/main/java/run/halo/app/handler/file/MinioFileHandler.java @@ -51,7 +51,7 @@ public UploadResult upload(@NonNull MultipartFile file) { String source = optionService.getByPropertyOrDefault(MinioProperties.SOURCE, String.class, ""); String region = - optionService.getByPropertyOfNonNull(MinioProperties.REGION).toString(); + optionService.getByPropertyOrDefault(MinioProperties.REGION, String.class, "us-east-1"); endpoint = StringUtils.appendIfMissing(endpoint, HaloConst.URL_SEPARATOR); @@ -78,6 +78,7 @@ public UploadResult upload(@NonNull MultipartFile file) { .stream(file.getInputStream(), file.getSize(), -1) .object(upFilePath) .build(); + minioClient.ignoreCertCheck(); minioClient.putObject(putObjectArgs); UploadResult uploadResult = new UploadResult(); @@ -114,7 +115,7 @@ public void delete(@NonNull String key) { String bucketName = optionService.getByPropertyOfNonNull(MinioProperties.BUCKET_NAME).toString(); String region = - optionService.getByPropertyOfNonNull(MinioProperties.REGION).toString(); + optionService.getByPropertyOrDefault(MinioProperties.REGION, String.class, "us-east-1"); MinioClient minioClient = MinioClient.builder() .endpoint(endPoint) @@ -123,6 +124,7 @@ public void delete(@NonNull String key) { .build(); try { + minioClient.ignoreCertCheck(); minioClient.removeObject(RemoveObjectArgs.builder() .bucket(bucketName) .object(key) diff --git a/src/main/java/run/halo/app/model/properties/MinioProperties.java b/src/main/java/run/halo/app/model/properties/MinioProperties.java index ec6c4e6b37..6af0365943 100644 --- a/src/main/java/run/halo/app/model/properties/MinioProperties.java +++ b/src/main/java/run/halo/app/model/properties/MinioProperties.java @@ -36,7 +36,7 @@ public enum MinioProperties implements PropertyEnum { /** * Minio regoin */ - REGION("minio_region", String.class, ""); + REGION("minio_region", String.class, "us-east-1"); private final String value;