Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'jetty-util/src/main/java/org/eclipse/jetty/util/ssl/SslContextFactory.java')
-rw-r--r--jetty-util/src/main/java/org/eclipse/jetty/util/ssl/SslContextFactory.java35
1 files changed, 27 insertions, 8 deletions
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/ssl/SslContextFactory.java b/jetty-util/src/main/java/org/eclipse/jetty/util/ssl/SslContextFactory.java
index 0ed0dcd732..8e9b6b8b4c 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/ssl/SslContextFactory.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/ssl/SslContextFactory.java
@@ -1,6 +1,6 @@
//
// ========================================================================
-// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2016 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
@@ -757,12 +757,12 @@ public class SslContextFactory extends AbstractLifeCycle
if (password==null)
{
if (_keyStoreResource!=null)
- _keyStorePassword=Password.getPassword(PASSWORD_PROPERTY,null,null);
+ _keyStorePassword= getPassword(PASSWORD_PROPERTY);
else
_keyStorePassword=null;
}
else
- _keyStorePassword = new Password(password);
+ _keyStorePassword = newPassword(password);
}
/**
@@ -778,12 +778,12 @@ public class SslContextFactory extends AbstractLifeCycle
if (password==null)
{
if (System.getProperty(KEYPASSWORD_PROPERTY)!=null)
- _keyManagerPassword = Password.getPassword(KEYPASSWORD_PROPERTY,null,null);
+ _keyManagerPassword = getPassword(KEYPASSWORD_PROPERTY);
else
_keyManagerPassword = null;
}
else
- _keyManagerPassword = new Password(password);
+ _keyManagerPassword = newPassword(password);
}
/**
@@ -801,12 +801,12 @@ public class SslContextFactory extends AbstractLifeCycle
{
// Do we need a truststore password?
if (_trustStoreResource!=null && !_trustStoreResource.equals(_keyStoreResource))
- _trustStorePassword = Password.getPassword(PASSWORD_PROPERTY,null,null);
+ _trustStorePassword = getPassword(PASSWORD_PROPERTY);
else
_trustStorePassword = null;
}
else
- _trustStorePassword=new Password(password);
+ _trustStorePassword=newPassword(password);
}
/**
@@ -837,6 +837,16 @@ public class SslContextFactory extends AbstractLifeCycle
{
return _sslProtocol;
}
+
+ /**
+ * Get the password object for the realm
+ * @param realm the realm
+ * @return the Password object
+ */
+ protected Password getPassword(String realm)
+ {
+ return Password.getPassword(realm, null, null);
+ }
/**
* @param protocol
@@ -1443,7 +1453,16 @@ public class SslContextFactory extends AbstractLifeCycle
{
_sslSessionTimeout = sslSessionTimeout;
}
-
+
+ /**
+ * Create a new Password object
+ * @param password the password string
+ * @return the new Password object
+ */
+ public Password newPassword(String password)
+ {
+ return new Password(password);
+ }
public SSLServerSocket newSslServerSocket(String host,int port,int backlog) throws IOException
{

Back to the top