mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
bug 13428: use static generated keystore to include intermediate CA certificates
Reviewed-by: Edison
This commit is contained in:
parent
65b7a27407
commit
847dde7896
Binary file not shown.
@ -19,6 +19,7 @@
|
|||||||
package com.cloud.consoleproxy;
|
package com.cloud.consoleproxy;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
|
import java.io.FileInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.security.KeyStore;
|
import java.security.KeyStore;
|
||||||
@ -49,13 +50,15 @@ public class ConsoleProxySecureServerFactoryImpl implements ConsoleProxyServerFa
|
|||||||
public void init(byte[] ksBits, String ksPassword) {
|
public void init(byte[] ksBits, String ksPassword) {
|
||||||
s_logger.info("Start initializing SSL");
|
s_logger.info("Start initializing SSL");
|
||||||
|
|
||||||
if(ksBits == null) {
|
// if(ksBits == null) {
|
||||||
try {
|
try {
|
||||||
s_logger.info("Initializing SSL from built-in default certificate");
|
s_logger.info("Initializing SSL from built-in default certificate");
|
||||||
|
|
||||||
char[] passphrase = "vmops.com".toCharArray();
|
char[] passphrase = "vmops.com".toCharArray();
|
||||||
KeyStore ks = KeyStore.getInstance("JKS");
|
KeyStore ks = KeyStore.getInstance("JKS");
|
||||||
ks.load(ConsoleProxy.class.getResourceAsStream("/realhostip.keystore"), passphrase);
|
|
||||||
|
ks.load(new FileInputStream("certs/realhostip.keystore"), passphrase);
|
||||||
|
// ks.load(ConsoleProxy.class.getResourceAsStream("/realhostip.keystore"), passphrase);
|
||||||
|
|
||||||
s_logger.info("SSL certificate loaded");
|
s_logger.info("SSL certificate loaded");
|
||||||
|
|
||||||
@ -73,6 +76,7 @@ public class ConsoleProxySecureServerFactoryImpl implements ConsoleProxyServerFa
|
|||||||
} catch (Exception ioe) {
|
} catch (Exception ioe) {
|
||||||
s_logger.error(ioe.toString(), ioe);
|
s_logger.error(ioe.toString(), ioe);
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
} else {
|
} else {
|
||||||
char[] passphrase = ksPassword != null ? ksPassword.toCharArray() : null;
|
char[] passphrase = ksPassword != null ? ksPassword.toCharArray() : null;
|
||||||
try {
|
try {
|
||||||
@ -96,6 +100,7 @@ public class ConsoleProxySecureServerFactoryImpl implements ConsoleProxyServerFa
|
|||||||
s_logger.error("Unable to init factory due to exception ", e);
|
s_logger.error("Unable to init factory due to exception ", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
public HttpServer createHttpServerInstance(int port) throws IOException {
|
public HttpServer createHttpServerInstance(int port) throws IOException {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user