You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2022/04/13 14:54:18 UTC

[GitHub] [cloudstack] DaanHoogland commented on a diff in pull request #6200: KVM: Enable SSL if keystore exists

DaanHoogland commented on code in PR #6200:
URL: https://github.com/apache/cloudstack/pull/6200#discussion_r849581494


##########
agent/src/main/java/com/cloud/agent/AgentShell.java:
##########
@@ -397,6 +399,24 @@ public void init(String[] args) throws ConfigurationException {
         _backoff.configure("ConstantTimeBackoff", new HashMap<String, Object>());
     }
 
+    private void enableSSL() {
+        final File agentFile = PropertiesUtil.findConfigFile("agent.properties");
+        if (agentFile == null) {
+            s_logger.info("Failed to find agent.properties file");
+            return;
+        }
+        String keystorePass = getProperty(null, "keystore.passphrase");
+        if (StringUtils.isBlank(keystorePass)) {
+            return;
+        }
+        final String keyStoreFile = agentFile.getParent() + "/" + KeyStoreUtils.KS_FILENAME;
+        File f = new File(keyStoreFile);
+        if (f.exists() && !f.isDirectory()) {

Review Comment:
   should we log an else for this? we now have a passphrase and no keystore.



##########
agent/src/main/java/com/cloud/agent/AgentShell.java:
##########
@@ -397,6 +399,24 @@ public void init(String[] args) throws ConfigurationException {
         _backoff.configure("ConstantTimeBackoff", new HashMap<String, Object>());
     }
 
+    private void enableSSL() {
+        final File agentFile = PropertiesUtil.findConfigFile("agent.properties");
+        if (agentFile == null) {
+            s_logger.info("Failed to find agent.properties file");
+            return;
+        }
+        String keystorePass = getProperty(null, "keystore.passphrase");
+        if (StringUtils.isBlank(keystorePass)) {
+            return;
+        }

Review Comment:
   we are not allowing a keystore without passphrase?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org