FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

kvm: fix error when enable SSL for kvm agent by weizhouapache · Pull Request #7923 · apache/cloudstack · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .java  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
*/
package com.cloud.agent.properties;

import org.apache.cloudstack.utils.security.KeyStoreUtils;

/**
* Class of constant agent's properties available to configure on
* "agent.properties".
Expand Down Expand Up @@ -728,6 +730,13 @@ public Property<Integer> getWorkers() {
*/
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>{
private String name;
private T defaultValue;
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -1012,7 +1012,7 @@ public boolean configure(final String name, final Map<String, Object> params) th
}
}

enableSSLForKvmAgent(params);
enableSSLForKvmAgent();
configureLocalStorage();

/* Directory to use for Qemu sockets like for the Qemu Guest Agent */
Expand Down Expand Up @@ -1319,13 +1319,13 @@ protected void setupMemoryBalloonStatsPeriod(Connect conn) {
}
}

private void enableSSLForKvmAgent(final Map<String, Object> params) {
private void enableSSLForKvmAgent() {
Comment thread
weizhouapache marked this conversation as resolved.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

We could have some unit tests for this method.

final File keyStoreFile = PropertiesUtil.findConfigFile(KeyStoreUtils.KS_FILENAME);
if (keyStoreFile == null) {
s_logger.info("Failed to find keystore file: " + KeyStoreUtils.KS_FILENAME);
return;
}
String keystorePass = (String)params.get(KeyStoreUtils.KS_PASSPHRASE_PROPERTY);
String keystorePass = AgentPropertiesFileHandler.getPropertyValue(AgentProperties.KEYSTORE_PASSPHRASE);
if (StringUtils.isBlank(keystorePass)) {
s_logger.info("Failed to find passphrase for keystore: " + KeyStoreUtils.KS_FILENAME);
return;
Expand Down

Back | FazBrowse Home | New Git URL