Commit 8f34557c authored by Daniel Hams's avatar Daniel Hams

Allow specifying a different network interface for the admin console via the...

Allow specifying a different network interface for the admin console via the "adminConsole.interface" configuration variable. If empty uses the standard interface configuration.
parent d643c5f0
......@@ -76,6 +76,8 @@ public class ConnectionManagerImpl extends BasicModule implements ConnectionMana
super("Connection Manager");
InetAddress bindAddress = null;
InetAddress adminConsoleBindAddress = null;
try
{
bindAddress = getListenAddress();
......@@ -85,6 +87,19 @@ public class ConnectionManagerImpl extends BasicModule implements ConnectionMana
Log.warn( "Unable to resolve bind address: ", e );
}
try
{
adminConsoleBindAddress = getAdminConsoleListenAddress();
if( adminConsoleBindAddress == null )
{
adminConsoleBindAddress = bindAddress;
}
}
catch( UnknownHostException e )
{
Log.warn( "Unable to resolve admin console bind address: ", e );
}
final CertificateStoreManager certificateStoreManager = XMPPServer.getInstance().getCertificateStoreManager();
// client-to-server
......@@ -230,7 +245,7 @@ public class ConnectionManagerImpl extends BasicModule implements ConnectionMana
null,
Connection.TLSPolicy.disabled.name(), // StartTLS over HTTP? Should use webAdminSslListener instead.
null,
bindAddress,
adminConsoleBindAddress,
certificateStoreManager.getIdentityStoreConfiguration( ConnectionType.WEBADMIN ),
certificateStoreManager.getTrustStoreConfiguration( ConnectionType.WEBADMIN ),
null // Should we have compression on the admin console?
......@@ -245,7 +260,7 @@ public class ConnectionManagerImpl extends BasicModule implements ConnectionMana
null,
Connection.TLSPolicy.legacyMode.name(),
null,
bindAddress,
adminConsoleBindAddress,
certificateStoreManager.getIdentityStoreConfiguration( ConnectionType.WEBADMIN ),
certificateStoreManager.getTrustStoreConfiguration( ConnectionType.WEBADMIN ),
null // Should we have compression on the admin console?
......@@ -343,6 +358,26 @@ public class ConnectionManagerImpl extends BasicModule implements ConnectionMana
return bindInterface;
}
/**
* Returns the specific network interface on which the Openfire administration
* console should be configured to listen, or null when no such preference
* has been configured.
*
* @return A network interface or null.
* @throws UnknownHostException When the configured network name cannot be resolved.
*/
public InetAddress getAdminConsoleListenAddress() throws UnknownHostException
{
String acInterfaceName = JiveGlobals.getXMLProperty( "adminConsole.interface" );
InetAddress acBindInterface = null;
if (acInterfaceName != null) {
if (acInterfaceName.trim().length() > 0) {
acBindInterface = InetAddress.getByName(acInterfaceName);
}
}
return acBindInterface;
}
/**
* Returns all connection listeners.
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment