Skip to content

Commit 3c00d68

Browse files
committed
directdownload: fix keytool importcert
``` $ /usr/bin/keytool -importcert file /etc/cloudstack/agent/CSCERTIFICATE-full -keystore /etc/cloudstack/agent/cloud.jks -alias full -storepass DAWsfkJeeGrmhta6 Illegal option: file keytool -importcert [OPTION]... Imports a certificate or a certificate chain Options: -noprompt do not prompt -trustcacerts trust certificates from cacerts -protected password through protected mechanism -alias <alias> alias name of the entry to process -file <file> input file name -keypass <arg> key password -keystore <keystore> keystore name -cacerts access the cacerts keystore -storepass <arg> keystore password -storetype <type> keystore type -providername <name> provider name -addprovider <name> add security provider by name (e.g. SunPKCS11) [-providerarg <arg>] configure argument for -addprovider -providerclass <class> add security provider by fully-qualified class name [-providerarg <arg>] configure argument for -providerclass -providerpath <list> provider classpath -v verbose output Use "keytool -?, -h, or --help" for this help message ```
1 parent cbd2b5a commit 3c00d68

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtSetupDirectDownloadCertificateCommandWrapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ private String getKeyStoreFilePath(File agentFile) {
8686
private void importCertificate(String tempCerFilePath, String keyStoreFile, String certificateName, String privatePassword) {
8787
s_logger.debug("Importing certificate from temporary file to keystore");
8888
String keyToolPath = Script.getExecutableAbsolutePath("keytool");
89-
int result = Script.executeCommandForExitValue(keyToolPath, "-importcert", "file", tempCerFilePath,
89+
int result = Script.executeCommandForExitValue(keyToolPath, "-importcert", "-file", tempCerFilePath,
9090
"-keystore", keyStoreFile, "-alias", sanitizeBashCommandArgument(certificateName), "-storepass",
9191
privatePassword, "-noprompt");
9292
if (result != 0) {

0 commit comments

Comments
 (0)