minioJava客户端调https接口报:xxx PKIX path building failed
Created by: secondarycoder
是什么版本出现了此问题?
1.4.11
使用的什么数据库?
MySQL 5.7
使用的哪种方式部署?
Fat Jar
在线站点地址
No response
发生了什么?
使用minIO上传附件时,如果是https协议则会上传失败,报:xxx PKIX path building failed。而S3客户端可以正常使用。经过查询资料,应该是服务端的ssl证书不在jdk的证书信任列表中。因此解决方法有两种:1.将服务端的ssl证书导入到jdk的证书信任列表中(更安全但操作复杂)2.绕过ssl验证 参考:https://github.com/minio/minio-java/issues/1032#issuecomment-671926716 使minIO绕过ssl验证
相关日志输出
run.halo.app.exception.FileOperationException: 上传附件 新建文本文档 (2).txt 到 MinIO 失败
at run.halo.app.handler.file.MinioFileHandler.upload(MinioFileHandler.java:95) ~[classes!/:1.4.11]
at run.halo.app.handler.file.FileHandlers.upload(FileHandlers.java:53) ~[classes!/:1.4.11]
at run.halo.app.service.impl.AttachmentServiceImpl.upload(AttachmentServiceImpl.java:116) ~[classes!/:1.4.11]
at run.halo.app.service.impl.AttachmentServiceImpl$$FastClassBySpringCGLIB$$2d9c80b9.invoke(<generated>) ~[classes!/:1.4.11]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.8.jar!/:5.3.8]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688) ~[spring-aop-5.3.8.jar!/:5.3.8]
at run.halo.app.service.impl.AttachmentServiceImpl$$EnhancerBySpringCGLIB$$13bba17.upload(<generated>) ~[classes!/:1.4.11]
......
Caused by: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:131) ~[na:na]
at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:349) ~[na:na]
at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:292) ~[na:na]
at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:287) ~[na:na]
at java.base/sun.security.ssl.CertificateMessage$T13CertificateConsumer.checkServerCerts(CertificateMessage.java:1356) ~[na:na]
at java.base/sun.security.ssl.CertificateMessage$T13CertificateConsumer.onConsumeCertificate(CertificateMessage.java:1231) ~[na:na]
at java.base/sun.security.ssl.CertificateMessage$T13CertificateConsumer.consume(CertificateMessage.java:1174) ~[na:na]
附加信息
No response