fix:解决内部自签证书https协议url文件无法下载的问题 (#396)

Co-authored-by: 鞠玉果 <juyg5@chinaunicom.cn>
This commit is contained in:
奋斗的小果
2022-12-28 10:40:56 +08:00
committed by GitHub
parent 69566834ea
commit ac3b0cb652
2 changed files with 48 additions and 0 deletions

View File

@ -35,6 +35,12 @@ public class DownloadUtils {
* @return 本地文件绝对路径
*/
public static ReturnResponse<String> downLoad(FileAttribute fileAttribute, String fileName) {
// 忽略ssl证书
try {
SslUtils.ignoreSsl();
} catch (Exception e) {
logger.error("忽略SSL证书异常:", e);
}
String urlStr = fileAttribute.getUrl().replaceAll("\\+", "%20");
ReturnResponse<String> response = new ReturnResponse<>(0, "下载成功!!!", "");
String realPath = DownloadUtils.getRelFilePath(fileName, fileAttribute);