Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/main/java/winstone/AbstractSecuredConnectorFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ protected void configureSsl(Map<String, String> args, Server server) throws IOEx

keystore = KeyStore.getInstance(KeyStore.getDefaultType());
try (InputStream inputStream = new FileInputStream(keyStore)) {
keystore.load(inputStream, this.keystorePassword.toCharArray());
keystore.load(
inputStream, this.keystorePassword == null ? null : this.keystorePassword.toCharArray());
}
} else {
throw new WinstoneException(MessageFormat.format("Please set --{0}", Option.HTTPS_KEY_STORE));
Expand Down Expand Up @@ -84,7 +85,7 @@ protected SslContextFactory.Server getSSLContext(Map<String, String> args) {

// In case the KeyStore password and the KeyPassword are not the same,
// the KeyManagerFactory needs the KeyPassword because it will access the individual key(s)
kmf.init(keystore, keystorePassword.toCharArray());
kmf.init(keystore, keystorePassword == null ? null : keystorePassword.toCharArray());
Logger.log(Level.FINEST, SSL_RESOURCES, "HttpsListener.KeyCount", keystore.size() + "");
for (Enumeration<String> e = keystore.aliases(); e.hasMoreElements(); ) {
String alias = e.nextElement();
Expand Down