fix(接口测试): 修复JDK11后SSL证书合并失败问题

--bug=1009833 --user=赵勇 【接口测试】github#9639,需要SSL认证的接口,证书配置正确的情况下,有时候证书认证会失效 https://www.tapd.cn/55049933/s/1163405
This commit is contained in:
fit2-zhao 2022-05-24 20:05:34 +08:00 committed by f2c-ci-robot[bot]
parent e226e45bd8
commit 195471b807
1 changed files with 2 additions and 1 deletions

View File

@ -7,6 +7,7 @@ import io.metersphere.commons.exception.MSException;
import io.metersphere.commons.utils.FileUtils;
import io.metersphere.commons.utils.LogUtil;
import io.metersphere.i18n.Translator;
import io.metersphere.utils.LoggerUtil;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.jorphan.exec.SystemCommand;
@ -122,7 +123,6 @@ public class CommandService {
File destFile = new File(newKeyStore);
List<String> arguments = new ArrayList();
arguments.add("keytool");
arguments.add("-genkeypair");
arguments.add("-importkeystore");
arguments.add("-srckeystore");
arguments.add(srcFile.getName());
@ -142,6 +142,7 @@ public class CommandService {
arguments.add("-destkeypass");
arguments.add("ms123...");
LoggerUtil.info("证书合并命令:", String.join(" ", arguments));
SystemCommand nativeCommand = new SystemCommand(destFile.getParentFile(), (Map) null);
int exitVal = nativeCommand.run(arguments);
if (exitVal > 0) {