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.java33
1 files changed, 26 insertions, 7 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 42f109c7d4..55877cd245 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
@@ -753,12 +753,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);
}
/**
@@ -774,12 +774,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);
}
/**
@@ -797,12 +797,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);
}
/**
@@ -833,6 +833,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
@@ -1439,7 +1449,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