diff --git a/api/src/com/cloud/api/commands/UploadCustomCertificateCmd.java b/api/src/com/cloud/api/commands/UploadCustomCertificateCmd.java
index 1db7fcb7901..5511a54d1b4 100644
--- a/api/src/com/cloud/api/commands/UploadCustomCertificateCmd.java
+++ b/api/src/com/cloud/api/commands/UploadCustomCertificateCmd.java
@@ -83,10 +83,10 @@ public class UploadCustomCertificateCmd extends BaseAsyncCmd {
@Override
public void execute(){
String result = _mgr.uploadCertificate(this);
- if (result != null){
+ if (result != null) {
CustomCertificateResponse response = new CustomCertificateResponse();
response.setResponseName(getCommandName());
- response.setUpdatedConsoleProxyIdList(result);
+ response.setResultMessage(result);
response.setObjectName("customcertificate");
this.setResponseObject(response);
} else {
diff --git a/api/src/com/cloud/api/response/CustomCertificateResponse.java b/api/src/com/cloud/api/response/CustomCertificateResponse.java
index 3af020579fa..c3d939e087f 100644
--- a/api/src/com/cloud/api/response/CustomCertificateResponse.java
+++ b/api/src/com/cloud/api/response/CustomCertificateResponse.java
@@ -22,15 +22,14 @@ import com.google.gson.annotations.SerializedName;
public class CustomCertificateResponse extends BaseResponse {
- @SerializedName("updatedconsoleproxyidlist") @Param(description="the list of the console proxy ids which were successfully updated")
- private String updatedConsoleProxyIdList;
+ @SerializedName("message") @Param(description="message of the certificate upload operation")
+ private String message;
- public String getUpdatedConsoleProxyIdList() {
- return updatedConsoleProxyIdList;
+ public String getResultMessage() {
+ return message;
}
- public void setUpdatedConsoleProxyIdList(String updatedConsoleProxyIdList) {
- this.updatedConsoleProxyIdList = updatedConsoleProxyIdList;
+ public void setResultMessage(String msg) {
+ this.message = msg;
}
-
}
diff --git a/client/WEB-INF/classes/resources/messages.properties b/client/WEB-INF/classes/resources/messages.properties
index 555bbc8f929..ca2e4d64240 100644
--- a/client/WEB-INF/classes/resources/messages.properties
+++ b/client/WEB-INF/classes/resources/messages.properties
@@ -225,6 +225,8 @@ label.bytes.received=Bytes Received
label.bytes.sent=Bytes Sent
label.cancel=Cancel
label.certificate=Certificate
+label.privatekey=Private Key
+label.domain.suffix=DNS Domain Suffix
label.character=Character
label.cidr.account=CIDR or Account/Security Group
label.close=Close
diff --git a/console-proxy/src/com/cloud/consoleproxy/ConsoleProxy.java b/console-proxy/src/com/cloud/consoleproxy/ConsoleProxy.java
index 21ac9d54c57..99f60a549b4 100644
--- a/console-proxy/src/com/cloud/consoleproxy/ConsoleProxy.java
+++ b/console-proxy/src/com/cloud/consoleproxy/ConsoleProxy.java
@@ -15,7 +15,6 @@
* along with this program. If not, see .
*
*/
-//
package com.cloud.consoleproxy;
import java.io.File;
diff --git a/server/src/com/cloud/keystore/KeystoreManagerImpl.java b/server/src/com/cloud/keystore/KeystoreManagerImpl.java
index 4b880e7edeb..6fa2a690cfc 100644
--- a/server/src/com/cloud/keystore/KeystoreManagerImpl.java
+++ b/server/src/com/cloud/keystore/KeystoreManagerImpl.java
@@ -76,7 +76,7 @@ public class KeystoreManagerImpl implements KeystoreManager {
try {
String ksPassword = "passwordForValidation";
- byte[] ksBits = CertificateHelper.buildAndSaveKeystore(domainSuffix, certificate, key, ksPassword);
+ byte[] ksBits = CertificateHelper.buildAndSaveKeystore(domainSuffix, certificate, getKeyContent(key), ksPassword);
KeyStore ks = CertificateHelper.loadKeystore(ksBits, ksPassword);
if(ks != null)
return true;
diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java
index 2ba0e556e30..46219461b85 100755
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@ -4564,7 +4564,7 @@ public class ManagementServerImpl implements ManagementServer {
_ksMgr.saveCertificate(ConsoleProxyManager.CERTIFICATE_NAME, cmd.getCertificate(), cmd.getPrivateKey(), cmd.getDomainSuffix());
_consoleProxyMgr.setManagementState(ConsoleProxyManagementState.ResetSuspending);
- return "Certificate has been updated, we will stop all running console proxy VMs for certificate propagation";
+ return "Certificate has been updated, we will stop all running console proxy VMs to propagate the new certificate, please give a few minutes for console access service to be up again";
}
@Override
diff --git a/ui/jsp/resource.jsp b/ui/jsp/resource.jsp
index a5a799c95cb..676d828e7ba 100644
--- a/ui/jsp/resource.jsp
+++ b/ui/jsp/resource.jsp
@@ -644,9 +644,19 @@
-
-
+
+ -
+
+
+
+
+ -
+
+
+
+
diff --git a/ui/scripts/cloud.core.resource.js b/ui/scripts/cloud.core.resource.js
index fe896b20b65..91b581ec4ec 100644
--- a/ui/scripts/cloud.core.resource.js
+++ b/ui/scripts/cloud.core.resource.js
@@ -1596,14 +1596,18 @@ function initUpdateConsoleCertButton($midMenuAddLink2) {
var isValid = true;
isValid &= validateString("SSL Certificate", $thisDialog.find("#update_cert"), $thisDialog.find("#update_cert_errormsg"), false, 4096);
+ isValid &= validateString("Private Key for Certificate", $thisDialog.find("#update_privatekey"), $thisDialog.find("#update_key_errormsg"), false, 4096);
+ isValid &= validateString("DNS domain suffix that certificate has been signed for", $thisDialog.find("#update_domainsuffix"), $thisDialog.find("#update_domainsuffix_errormsg"), false, 4096);
if (!isValid) return;
$spinningWheel = $thisDialog.find("#spinning_wheel").show();
var cert = trim($thisDialog.find("#update_cert").val());
+ var privateKey = trim($thisDialog.find("#update_privatekey").val());
+ var domainSuffix = trim($thisDialog.find("#update_domainsuffix").val());
$.ajax({
- data: createURL("command=uploadCustomCertificate&certificate="+todb(cert)),
+ data: createURL("command=uploadCustomCertificate&certificate="+todb(cert)+"&privatekey="+todb(privateKey)+"&domainsuffix="+todb(domainSuffix)),
dataType: "json",
success: function(json) {
var jobId = json.uploadcustomcertificateresponse.jobid;