Commit c0f5026e authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Restart Jetty when certificates are modified. JM-892

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@6098 b35dd754-fafc-0310-a699-88a17e54d16e
parent d2526d65
......@@ -1534,6 +1534,8 @@ ssl.certificates.error_importing-reply=An error occured while importing the Cert
the reply is correct and that it belongs to the correct certificate.
ssl.certificates.imported=Certificate Authority reply was imported successfully.
ssl.certificates.ca-reply=Certificate Authority Reply:
ssl.certificates.restart_server=Certificates were modified so HTTP server needs to be restarted. Click {0}here{1} to \
restart HTTP server.
ssl.certificates.no_installed=One or more certificates are not installed. Click {0}here{1} to generate self-signed \
certificates.
ssl.certificates.issuer-updated=Issuer information updated successfully.
......@@ -1574,6 +1576,12 @@ ssl.signing-request.requests_info=Below you will find the signing requests gener
ssl.signing-request.alias=Alias
ssl.signing-request.signing-request=Signing Request
# Restart HTTP server
server-restart.title=HTTP Server Restart
server-restart.info=The HTTP server will be restarted. In a few seconds you will be redirected to the login page. \
In case that redirection fails click {0}here{1} to go to the login page.
# Compression settings Page
compression.settings.title=Nastaven\u00ed komprese
......
......@@ -1312,6 +1312,8 @@ ssl.certificates.error_importing-reply=An error occured while importing the Cert
the reply is correct and that it belongs to the correct certificate.
ssl.certificates.imported=Certificate Authority reply was imported successfully.
ssl.certificates.ca-reply=Certificate Authority Reply:
ssl.certificates.restart_server=Certificates were modified so HTTP server needs to be restarted. Click {0}here{1} to \
restart HTTP server.
ssl.certificates.no_installed=One or more certificates are not installed. Click {0}here{1} to generate self-signed \
certificates.
ssl.certificates.issuer-updated=Issuer information updated successfully.
......@@ -1352,6 +1354,12 @@ ssl.signing-request.requests_info=Below you will find the signing requests gener
ssl.signing-request.alias=Alias
ssl.signing-request.signing-request=Signing Request
# Restart HTTP server
server-restart.title=HTTP Server Restart
server-restart.info=The HTTP server will be restarted. In a few seconds you will be redirected to the login page. \
In case that redirection fails click {0}here{1} to go to the login page.
# Compression settings Page
compression.settings.title=Komprimierungseinstellungen
......
......@@ -181,6 +181,7 @@
## Added key: 'global.save'
## Added section: 'ssl.certificates.*'
## Added section: 'ssl.signing-request.*'
## Added section: 'server-restart.*'
## Removed key: 'ssl.certificates.uninstalled'
## Removed key: 'ssl.certificates.error_certificate'
## Removed key: 'ssl.certificates.certificate'
......@@ -1738,6 +1739,8 @@ ssl.certificates.error_importing-reply=An error occured while importing the Cert
the reply is correct and that it belongs to the correct certificate.
ssl.certificates.imported=Certificate Authority reply was imported successfully.
ssl.certificates.ca-reply=Certificate Authority Reply:
ssl.certificates.restart_server=Certificates were modified so HTTP server needs to be restarted. Click {0}here{1} to \
restart HTTP server.
ssl.certificates.no_installed=One or more certificates are not installed. Click {0}here{1} to generate self-signed \
certificates.
ssl.certificates.issuer-updated=Issuer information updated successfully.
......@@ -1778,6 +1781,12 @@ ssl.signing-request.requests_info=Below you will find the signing requests gener
ssl.signing-request.alias=Alias
ssl.signing-request.signing-request=Signing Request
# Restart HTTP server
server-restart.title=HTTP Server Restart
server-restart.info=The HTTP server will be restarted. In a few seconds you will be redirected to the login page. \
In case that redirection fails click {0}here{1} to go to the login page.
# Compression settings Page
compression.settings.title=Compression Settings
......
......@@ -1426,6 +1426,8 @@ ssl.certificates.error_importing-reply=Un error ha occurido mientras se estaba i
Autoridad Certificadora. Verifique que la respuesta sea correcta y que pertenece al certificado.
ssl.certificates.imported=Respuesta de la Autoridad Certificadora ha sido importada exitosamente.
ssl.certificates.ca-reply=Respuesta de la Autoridad Certificadora:
ssl.certificates.restart_server=El servidor HTTP debe ser reiniciado ya que los certificados han sido modificados. Haga \
clic {0}aqu\u00ed{1} para reiniciar el servidor HTTP.
ssl.certificates.no_installed=Uno o m\u00e1s certificados no se han instalado. Haga clic {0}aqu\u00ed{1} para generar \
certificados auto-firmados.
ssl.certificates.issuer-updated=Informaci\u00f3n de la entidad emisora actualizada exitosamente.
......@@ -1467,6 +1469,12 @@ ssl.signing-request.requests_info=A continuaci\u00f3n se listan los pedidos de f
ssl.signing-request.alias=Alias
ssl.signing-request.signing-request=Pedido de Firma
# Restart HTTP server
server-restart.title=Reiniciar Servidor HTTP
server-restart.info=El servidor HTTP ser\u00e1 reiniciado. En unos segundos ser\u00e1 redirigido a la p\u00e1gina de ingreso. \
En caso que la redicci\u00f3n falle haga clic {0}aqu\u00ed{1} para ir a la p\u00e1gina de ingreso.
# Compression settings Page
compression.settings.title=Configuraci\u00f3n de compresi\u00f3n
......
......@@ -1223,6 +1223,8 @@ ssl.certificates.error_importing-reply=An error occured while importing the Cert
the reply is correct and that it belongs to the correct certificate.
ssl.certificates.imported=Certificate Authority reply was imported successfully.
ssl.certificates.ca-reply=Certificate Authority Reply:
ssl.certificates.restart_server=Certificates were modified so HTTP server needs to be restarted. Click {0}here{1} to \
restart HTTP server.
ssl.certificates.no_installed=One or more certificates are not installed. Click {0}here{1} to generate self-signed \
certificates.
ssl.certificates.issuer-updated=Issuer information updated successfully.
......@@ -1263,6 +1265,12 @@ ssl.signing-request.requests_info=Below you will find the signing requests gener
ssl.signing-request.alias=Alias
ssl.signing-request.signing-request=Signing Request
# Restart HTTP server
server-restart.title=HTTP Server Restart
server-restart.info=The HTTP server will be restarted. In a few seconds you will be redirected to the login page. \
In case that redirection fails click {0}here{1} to go to the login page.
# Compression settings Page
compression.settings.title = Param\u00E8tres de Compression
compression.settings.update = Param\u00E8tres mis \u00E0 jour avec succ\u00E8s.
......
......@@ -1313,6 +1313,8 @@ ssl.certificates.error_importing-reply=An error occured while importing the Cert
the reply is correct and that it belongs to the correct certificate.
ssl.certificates.imported=Certificate Authority reply was imported successfully.
ssl.certificates.ca-reply=Certificate Authority Reply:
ssl.certificates.restart_server=Certificates were modified so HTTP server needs to be restarted. Click {0}here{1} to \
restart HTTP server.
ssl.certificates.no_installed=One or more certificates are not installed. Click {0}here{1} to generate self-signed \
certificates.
ssl.certificates.issuer-updated=Issuer information updated successfully.
......@@ -1353,6 +1355,12 @@ ssl.signing-request.requests_info=Below you will find the signing requests gener
ssl.signing-request.alias=Alias
ssl.signing-request.signing-request=Signing Request
# Restart HTTP server
server-restart.title=HTTP Server Restart
server-restart.info=The HTTP server will be restarted. In a few seconds you will be redirected to the login page. \
In case that redirection fails click {0}here{1} to go to the login page.
# Compression settings Page
compression.settings.title=Compression Settings
......
......@@ -1293,6 +1293,8 @@ ssl.certificates.error_importing-reply=An error occured while importing the Cert
the reply is correct and that it belongs to the correct certificate.
ssl.certificates.imported=Certificate Authority reply was imported successfully.
ssl.certificates.ca-reply=Certificate Authority Reply:
ssl.certificates.restart_server=Certificates were modified so HTTP server needs to be restarted. Click {0}here{1} to \
restart HTTP server.
ssl.certificates.no_installed=One or more certificates are not installed. Click {0}here{1} to generate self-signed \
certificates.
ssl.certificates.issuer-updated=Issuer information updated successfully.
......@@ -1333,6 +1335,12 @@ ssl.signing-request.requests_info=Below you will find the signing requests gener
ssl.signing-request.alias=Alias
ssl.signing-request.signing-request=Signing Request
# Restart HTTP server
server-restart.title=HTTP Server Restart
server-restart.info=The HTTP server will be restarted. In a few seconds you will be redirected to the login page. \
In case that redirection fails click {0}here{1} to go to the login page.
# Compression settings Page
compression.settings.title=Ustawienia kompresji
......
......@@ -1310,6 +1310,8 @@ ssl.certificates.error_importing-reply=An error occured while importing the Cert
the reply is correct and that it belongs to the correct certificate.
ssl.certificates.imported=Certificate Authority reply was imported successfully.
ssl.certificates.ca-reply=Certificate Authority Reply:
ssl.certificates.restart_server=Certificates were modified so HTTP server needs to be restarted. Click {0}here{1} to \
restart HTTP server.
ssl.certificates.no_installed=One or more certificates are not installed. Click {0}here{1} to generate self-signed \
certificates.
ssl.certificates.issuer-updated=Issuer information updated successfully.
......@@ -1350,6 +1352,12 @@ ssl.signing-request.requests_info=Below you will find the signing requests gener
ssl.signing-request.alias=Alias
ssl.signing-request.signing-request=Signing Request
# Restart HTTP server
server-restart.title=HTTP Server Restart
server-restart.info=The HTTP server will be restarted. In a few seconds you will be redirected to the login page. \
In case that redirection fails click {0}here{1} to go to the login page.
# Compression settings Page
compression.settings.title=Configura\u00e7\u00f5es de Compress\u00e3o
......
......@@ -1380,6 +1380,8 @@ ssl.certificates.error_importing-reply=An error occured while importing the Cert
the reply is correct and that it belongs to the correct certificate.
ssl.certificates.imported=Certificate Authority reply was imported successfully.
ssl.certificates.ca-reply=Certificate Authority Reply:
ssl.certificates.restart_server=Certificates were modified so HTTP server needs to be restarted. Click {0}here{1} to \
restart HTTP server.
ssl.certificates.no_installed=One or more certificates are not installed. Click {0}here{1} to generate self-signed \
certificates.
ssl.certificates.issuer-updated=Issuer information updated successfully.
......@@ -1420,6 +1422,12 @@ ssl.signing-request.requests_info=Below you will find the signing requests gener
ssl.signing-request.alias=Alias
ssl.signing-request.signing-request=Signing Request
# Restart HTTP server
server-restart.title=HTTP Server Restart
server-restart.info=The HTTP server will be restarted. In a few seconds you will be redirected to the login page. \
In case that redirection fails click {0}here{1} to go to the login page.
# Compression settings Page
compression.settings.title=\u538b\u7f29\u8bbe\u7f6e
......
......@@ -570,6 +570,34 @@ public class XMPPServer {
}
}
/**
* Restarts the HTTP server only when running in stand alone mode. The restart process will be done
* in another thread that will wait 1 second before doing the actual restart. The delay will give time
* to the page that requested the restart to fully render its content.
*/
public void restartHTTPServer() {
Thread restartThread = new Thread() {
public void run() {
if (isStandAlone()) {
// Restart the HTTP server manager. This covers the case
// of changing the ports, as well as generating self-signed certificates.
// Wait a short period before shutting down the admin console.
// Otherwise, this page won't render properly!
try {
Thread.sleep(1000);
httpServerManager.shutdown();
httpServerManager.startup();
} catch (Exception e) {
e.printStackTrace();
}
}
}
};
restartThread.setContextClassLoader(loader);
restartThread.start();
}
/**
* Stops the server only if running in standalone mode. Do nothing if the server is running
* inside of another server.
......
......@@ -13,6 +13,7 @@
<%@ page import="java.util.Enumeration" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="java.util.Map" %>
<%@ page import="org.jivesoftware.wildfire.HttpServerManager" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>
......@@ -92,7 +93,21 @@
</head>
<body>
<% if (keyStore.size() < 2 ) { %>
<% if (HttpServerManager.getInstance().isRestartNeeded()) { %>
<div class="warning">
<table cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr>
<td class="jive-icon-label">
<fmt:message key="ssl.certificates.restart_server">
<fmt:param value="<%= "<a href='server-restart.jsp?page=ssl-certificates.jsp'>" %>" />
<fmt:param value="<%= "</a>" %>" />
</fmt:message>
</td></tr>
</tbody>
</table>
</div><br>
<% } else if (keyStore.size() < 2 ) { %>
<div class="warning">
<table cellpadding="0" cellspacing="0" border="0">
<tbody>
......
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