fix(接口测试): 加载证书时没有关闭输入流

This commit is contained in:
AgAngle 2023-11-22 15:51:04 +08:00 committed by 刘瑞斌
parent 04abe38601
commit ae9a453ba7
1 changed files with 3 additions and 3 deletions

View File

@ -155,9 +155,9 @@ public abstract class SSLManager {
if (StringUtils.isNotBlank(resourceId) && keyMap.containsKey(resourceId)) {
KeystoreDTO dto = keyMap.get(resourceId);
// 加载认证文件
InputStream in = new FileInputStream(new File(dto.getPath()));
this.keyStore.load(in, dto.getPwd());
try (InputStream in = new FileInputStream(new File(dto.getPath()))) {
this.keyStore.load(in, dto.getPwd());
}
}
}
} catch (Exception e) {