证书文件新增cer类型文件支持

This commit is contained in:
bwcx_jzy 2019-06-04 11:42:46 +08:00
parent f3a244d8de
commit 46f555c871
4 changed files with 16 additions and 10 deletions

View File

@ -8,6 +8,7 @@
2. 【Agent】新增节点脚本模板(感谢@其锋)
3. 【Server】新增所有页面添加公共Html代码
4. 新增Tomcat管理
5. 【Agent】导入证书文件新增对cer、crt文件支持
### 解决BUG、优化功能

View File

@ -141,21 +141,16 @@ public class CertificateController extends BaseAgentController {
continue;
}
String keyName = zipEntry.getName();
if (pemPath == null && StrUtil.endWith(keyName, ".pem", true)) {
// pemcercrt
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);

View File

@ -0,0 +1,10 @@
:: 设置环境变量
:: 关闭终端回显
@echo off
set ENV_PATH=%LESSCHARSET%
@echo ====current environment
@echo %ENV_PATH%
pause

View File

@ -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">