mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
kvm: fix error 'Failed to find passphrase for keystore: cloud.jks' when enable SSL for kvm agent (#7923)
This commit is contained in:
parent
db6dd52f44
commit
7ea068c4dc
@ -14,6 +14,8 @@
|
|||||||
*/
|
*/
|
||||||
package com.cloud.agent.properties;
|
package com.cloud.agent.properties;
|
||||||
|
|
||||||
|
import org.apache.cloudstack.utils.security.KeyStoreUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class of constant agent's properties available to configure on
|
* Class of constant agent's properties available to configure on
|
||||||
* "agent.properties".
|
* "agent.properties".
|
||||||
@ -728,6 +730,13 @@ public class AgentProperties{
|
|||||||
*/
|
*/
|
||||||
public static final Property<String> CONTROL_CIDR = new Property<>("control.cidr", "169.254.0.0/16");
|
public static final Property<String> CONTROL_CIDR = new Property<>("control.cidr", "169.254.0.0/16");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Keystore passphrase
|
||||||
|
* Data type: String.<br>
|
||||||
|
* Default value: <code>null</code>
|
||||||
|
*/
|
||||||
|
public static final Property<String> KEYSTORE_PASSPHRASE = new Property<>(KeyStoreUtils.KS_PASSPHRASE_PROPERTY, null, String.class);
|
||||||
|
|
||||||
public static class Property <T>{
|
public static class Property <T>{
|
||||||
private String name;
|
private String name;
|
||||||
private T defaultValue;
|
private T defaultValue;
|
||||||
|
|||||||
@ -1012,7 +1012,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enableSSLForKvmAgent(params);
|
enableSSLForKvmAgent();
|
||||||
configureLocalStorage();
|
configureLocalStorage();
|
||||||
|
|
||||||
/* Directory to use for Qemu sockets like for the Qemu Guest Agent */
|
/* Directory to use for Qemu sockets like for the Qemu Guest Agent */
|
||||||
@ -1319,13 +1319,13 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void enableSSLForKvmAgent(final Map<String, Object> params) {
|
private void enableSSLForKvmAgent() {
|
||||||
final File keyStoreFile = PropertiesUtil.findConfigFile(KeyStoreUtils.KS_FILENAME);
|
final File keyStoreFile = PropertiesUtil.findConfigFile(KeyStoreUtils.KS_FILENAME);
|
||||||
if (keyStoreFile == null) {
|
if (keyStoreFile == null) {
|
||||||
s_logger.info("Failed to find keystore file: " + KeyStoreUtils.KS_FILENAME);
|
s_logger.info("Failed to find keystore file: " + KeyStoreUtils.KS_FILENAME);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String keystorePass = (String)params.get(KeyStoreUtils.KS_PASSPHRASE_PROPERTY);
|
String keystorePass = AgentPropertiesFileHandler.getPropertyValue(AgentProperties.KEYSTORE_PASSPHRASE);
|
||||||
if (StringUtils.isBlank(keystorePass)) {
|
if (StringUtils.isBlank(keystorePass)) {
|
||||||
s_logger.info("Failed to find passphrase for keystore: " + KeyStoreUtils.KS_FILENAME);
|
s_logger.info("Failed to find passphrase for keystore: " + KeyStoreUtils.KS_FILENAME);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user