内置可信证书上传minio,入库,并下发
This commit is contained in:
@@ -483,6 +483,49 @@ public class PxyObjKeyringService extends BaseService{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void caCertSaveAndAudit(List<PxyObjTrustedCaCert> cfgList){
|
||||
|
||||
//修改主表cert 配置状态
|
||||
for (PxyObjTrustedCaCert cfg : cfgList) {
|
||||
//调用服务接口获取compileId
|
||||
List<Integer> compileIds = new ArrayList<Integer>();
|
||||
try {
|
||||
compileIds = ConfigServiceUtil.getId(1,1);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("获取编译ID出错");
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||
}
|
||||
if(compileIds != null && compileIds.size() >0 && compileIds.get(0) != 0){
|
||||
cfg.setCompileId(compileIds.get(0));
|
||||
}
|
||||
pxyObjKeyringDao.insertPxyObjTrustedCaCert(cfg);
|
||||
}
|
||||
|
||||
String json="";
|
||||
List<ProxyObjTrustedCa> trustedCertList=new ArrayList<ProxyObjTrustedCa>();
|
||||
//可信证书cert回调配置转换
|
||||
for (PxyObjTrustedCaCert cfg : cfgList) {
|
||||
trustedCertList.addAll(convertCallBackProxyObjTrustedCa(cfg,null));
|
||||
}
|
||||
//调用服务接口下发配置数据
|
||||
json=gsonToJson(trustedCertList);
|
||||
logger.info("可信证书(cert+crl)配置下发配置参数:"+json);
|
||||
//调用服务接口下发配置
|
||||
try {
|
||||
ToMaatResult result = ConfigServiceUtil.postCallbackCfg(json);
|
||||
if(result!=null){
|
||||
logger.info("可信证书(内置)配置下发响应信息:"+result.getMsg());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("可信证书(内置)配置下发失败",e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user