Commit 50eefe72 authored by Guus der Kinderen's avatar Guus der Kinderen

Merge leftovers.

parent fc26b5d7
...@@ -337,12 +337,19 @@ public class AdminConsolePlugin implements Plugin { ...@@ -337,12 +337,19 @@ public class AdminConsolePlugin implements Plugin {
if (Boolean.getBoolean("developmentMode")) { if (Boolean.getBoolean("developmentMode")) {
System.out.println(LocaleUtils.getLocalizedString("admin.console.devmode")); System.out.println(LocaleUtils.getLocalizedString("admin.console.devmode"));
context = new WebAppContext(contexts, pluginDir.getParentFile().getParentFile().getParentFile().getParent() + context = new WebAppContext(contexts, pluginDir.getParentFile().getParentFile().getParentFile().getParent() +
File.separator + "src" + File.separator + "web", "/"); File.separator + "src" + File.separator + "web", "/");
} }
else { else {
context = new WebAppContext(contexts, pluginDir.getAbsoluteFile() + File.separator + "webapp", context = new WebAppContext(contexts, pluginDir.getAbsoluteFile() + File.separator + "webapp",
"/"); "/");
} }
// Ensure the JSP engine is initialized correctly (in order to be able to cope with Tomcat/Jasper precompiled JSPs).
final List<ContainerInitializer> initializers = new ArrayList<>();
initializers.add(new ContainerInitializer(new JettyJasperInitializer(), null));
context.setAttribute("org.eclipse.jetty.containerInitializers", initializers);
context.setAttribute(InstanceManager.class.getName(), new SimpleInstanceManager());
context.setWelcomeFiles(new String[]{"index.jsp"}); context.setWelcomeFiles(new String[]{"index.jsp"});
} }
......
...@@ -23,10 +23,7 @@ package org.jivesoftware.openfire.http; ...@@ -23,10 +23,7 @@ package org.jivesoftware.openfire.http;
import java.io.File; import java.io.File;
import java.security.KeyStore; import java.security.KeyStore;
import java.security.cert.X509Certificate; import java.security.cert.X509Certificate;
import java.util.EnumSet; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.DispatcherType; import javax.servlet.DispatcherType;
import javax.servlet.Filter; import javax.servlet.Filter;
......
...@@ -194,7 +194,7 @@ public class SocketConnection implements Connection { ...@@ -194,7 +194,7 @@ public class SocketConnection implements Connection {
// Start handshake // Start handshake
tlsStreamHandler.start(); tlsStreamHandler.start();
// Use new wrapped writers // Use new wrapped writers
writer = new BufferedWriter(new OutputStreamWriter(tlsStreamHandler.getOutputStream(), CHARSET)); writer = new BufferedWriter(new OutputStreamWriter(tlsStreamHandler.getOutputStream(), StandardCharsets.UTF_8));
xmlSerializer = new XMLSocketWriter(writer, this); xmlSerializer = new XMLSocketWriter(writer, this);
} }
} }
......
...@@ -31,7 +31,9 @@ import java.net.UnknownHostException; ...@@ -31,7 +31,9 @@ import java.net.UnknownHostException;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import java.nio.charset.CharsetEncoder; import java.nio.charset.CharsetEncoder;
import java.nio.charset.CodingErrorAction; import java.nio.charset.CodingErrorAction;
import java.nio.charset.StandardCharsets;
import java.security.cert.Certificate; import java.security.cert.Certificate;
import java.util.concurrent.atomic.AtomicReference;
import java.util.concurrent.locks.ReentrantLock; import java.util.concurrent.locks.ReentrantLock;
import javax.net.ssl.*; import javax.net.ssl.*;
...@@ -68,8 +70,6 @@ public class NIOConnection implements Connection { ...@@ -68,8 +70,6 @@ public class NIOConnection implements Connection {
private static final Logger Log = LoggerFactory.getLogger(NIOConnection.class); private static final Logger Log = LoggerFactory.getLogger(NIOConnection.class);
private ConnectionConfiguration configuration; private ConnectionConfiguration configuration;
public enum State { RUNNING, CLOSING, CLOSED }
/** /**
* The utf-8 charset for decoding and encoding XMPP packet streams. * The utf-8 charset for decoding and encoding XMPP packet streams.
*/ */
...@@ -108,7 +108,7 @@ public class NIOConnection implements Connection { ...@@ -108,7 +108,7 @@ public class NIOConnection implements Connection {
* keep this flag to avoid using the connection between #close was used and the socket is actually * keep this flag to avoid using the connection between #close was used and the socket is actually
* closed. * closed.
*/ */
private AtomicReference<State> state = new AtomicReference<State>(State.OPEN); private AtomicReference<State> state = new AtomicReference<>(State.OPEN);
/** /**
* Lock used to ensure the integrity of the underlying IoSession (refer to * Lock used to ensure the integrity of the underlying IoSession (refer to
...@@ -125,7 +125,6 @@ public class NIOConnection implements Connection { ...@@ -125,7 +125,6 @@ public class NIOConnection implements Connection {
this.ioSession = session; this.ioSession = session;
this.backupDeliverer = packetDeliverer; this.backupDeliverer = packetDeliverer;
this.configuration = configuration; this.configuration = configuration;
state = State.RUNNING;
} }
@Override @Override
......
...@@ -483,6 +483,9 @@ ...@@ -483,6 +483,9 @@
case WEBADMIN: case WEBADMIN:
typeName = LocaleUtils.getLocalizedString("ports.admin_console"); typeName = LocaleUtils.getLocalizedString("ports.admin_console");
break; break;
case BOSH_C2S:
typeName = LocaleUtils.getLocalizedString("ports.http_bind");
break;
default: default:
typeName = "(unspecified)"; typeName = "(unspecified)";
break; break;
...@@ -517,6 +520,13 @@ ...@@ -517,6 +520,13 @@
description = LocaleUtils.getLocalizedString( "ports.admin_console.desc_unsecured" ); description = LocaleUtils.getLocalizedString( "ports.admin_console.desc_unsecured" );
} }
break; break;
case BOSH_C2S:
if ( connectionListener.getTLSPolicy().equals( Connection.TLSPolicy.legacyMode ) ) {
description = LocaleUtils.getLocalizedString( "ports.http_bind.desc_secured" );
} else {
description = LocaleUtils.getLocalizedString( "ports.http_bind.desc_unsecured" );
}
break;
default: default:
description = ""; description = "";
break; break;
...@@ -546,32 +556,6 @@ ...@@ -546,32 +556,6 @@
<td><fmt:message key="ports.file_proxy.desc" /></td> <td><fmt:message key="ports.file_proxy.desc" /></td>
</tr> </tr>
<% } %> <% } %>
<%
if (httpBindManager.isHttpBindEnabled()) {
%>
<%
if (httpBindManager.getHttpBindUnsecurePort() > 0) {
%>
<tr>
<td><%= interfaceName %></td>
<td><%= httpBindManager.getHttpBindUnsecurePort() %></td>
<td><img src="images/blank.gif" width="1" height="1" alt=""></td>
<td><fmt:message key="ports.http_bind" /></td>
<td><fmt:message key="ports.http_bind.desc_unsecured" /></td>
</tr>
<% } %>
<%
if (httpBindManager.isHttpsBindActive()) {
%>
<tr>
<td><%= interfaceName %></td>
<td><%= httpBindManager.getHttpBindSecurePort() %></td>
<td><img src="images/lock.gif" width="16" height="16" border="0" alt="<fmt:message key="ports.secure.alt" />" title="<fmt:message key="ports.secure.alt" />"/></td>
<td><fmt:message key="ports.http_bind" /></td>
<td><fmt:message key="ports.http_bind.desc_secured" /></td>
</tr>
<% } %>
<% } %>
<% <%
if (mediaProxyService.isEnabled()) { if (mediaProxyService.isEnabled()) {
%> %>
......
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