mirror of
https://gitee.com/dromara/Jpom.git
synced 2024-11-29 18:38:32 +08:00
证书文件新增cer类型文件支持
This commit is contained in:
parent
f3a244d8de
commit
46f555c871
@ -8,6 +8,7 @@
|
||||
2. 【Agent】新增节点脚本模板(感谢@其锋)
|
||||
3. 【Server】新增所有页面添加公共Html代码
|
||||
4. 新增Tomcat管理
|
||||
5. 【Agent】导入证书文件新增对cer、crt文件支持
|
||||
|
||||
### 解决BUG、优化功能
|
||||
|
||||
|
@ -141,21 +141,16 @@ public class CertificateController extends BaseAgentController {
|
||||
continue;
|
||||
}
|
||||
String keyName = zipEntry.getName();
|
||||
if (pemPath == null && StrUtil.endWith(keyName, ".pem", true)) {
|
||||
// pem、cer、crt
|
||||
if (pemPath == null && (StrUtil.endWith(keyName, ".pem", true) ||
|
||||
StrUtil.endWith(keyName, ".cer", true) ||
|
||||
StrUtil.endWith(keyName, ".crt", true))) {
|
||||
String filePathItem = String.format("%s/%s/%s", path, certModel.getId(), keyName);
|
||||
InputStream inputStream = zipFile.getInputStream(zipEntry);
|
||||
FileUtil.writeFromStream(inputStream, filePathItem);
|
||||
certModel.setType(CertModel.Type.pem);
|
||||
pemPath = filePathItem;
|
||||
}
|
||||
// cer 文件
|
||||
if (pemPath == null && StrUtil.endWith(keyName, ".cer", true)) {
|
||||
String filePathItem = String.format("%s/%s/%s", path, certModel.getId(), keyName);
|
||||
InputStream inputStream = zipFile.getInputStream(zipEntry);
|
||||
FileUtil.writeFromStream(inputStream, filePathItem);
|
||||
certModel.setType(CertModel.Type.cer);
|
||||
pemPath = filePathItem;
|
||||
}
|
||||
//
|
||||
if (keyPath == null && StrUtil.endWith(keyName, ".key", true)) {
|
||||
String filePathItem = String.format("%s/%s/%s", path, certModel.getId(), keyName);
|
||||
|
10
modules/common/src/test/resources/test.bat
Normal file
10
modules/common/src/test/resources/test.bat
Normal file
@ -0,0 +1,10 @@
|
||||
:: 设置环境变量
|
||||
|
||||
:: 关闭终端回显
|
||||
@echo off
|
||||
|
||||
set ENV_PATH=%LESSCHARSET%
|
||||
@echo ====current environment:
|
||||
@echo %ENV_PATH%
|
||||
|
||||
pause
|
@ -69,7 +69,7 @@
|
||||
<div class="layui-form-mid layui-word-aux"></div>
|
||||
<div class="layui-form-mid layui-word-aux" id="zipResult"></div>
|
||||
</div>
|
||||
<div class="layui-form-mid layui-word-aux">证书文件包里必须有.pem .key文件</div>
|
||||
<div class="layui-form-mid layui-word-aux">证书文件包里必须有(pem、crt、cer) .key文件</div>
|
||||
|
||||
</div>
|
||||
<input type="hidden" lay-submit lay-filter="submitCert" id="cert_submit">
|
||||
|
Loading…
Reference in New Issue
Block a user