|
|
@ -180,7 +180,7 @@ public class JettyEmbeddedServletContainerFactory
|
|
|
|
SslContextFactory sslContextFactory = new SslContextFactory();
|
|
|
|
SslContextFactory sslContextFactory = new SslContextFactory();
|
|
|
|
configureSsl(sslContextFactory, getSsl());
|
|
|
|
configureSsl(sslContextFactory, getSsl());
|
|
|
|
AbstractConnector connector = getSslServerConnectorFactory()
|
|
|
|
AbstractConnector connector = getSslServerConnectorFactory()
|
|
|
|
.getConnector(server, sslContextFactory, port);
|
|
|
|
.createConnector(server, sslContextFactory, address);
|
|
|
|
server.setConnectors(new Connector[] { connector });
|
|
|
|
server.setConnectors(new Connector[] { connector });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (JettyServerCustomizer customizer : getServerCustomizers()) {
|
|
|
|
for (JettyServerCustomizer customizer : getServerCustomizers()) {
|
|
|
@ -700,8 +700,8 @@ public class JettyEmbeddedServletContainerFactory
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private interface SslServerConnectorFactory {
|
|
|
|
private interface SslServerConnectorFactory {
|
|
|
|
|
|
|
|
|
|
|
|
AbstractConnector getConnector(Server server, SslContextFactory sslContextFactory,
|
|
|
|
AbstractConnector createConnector(Server server,
|
|
|
|
int port);
|
|
|
|
SslContextFactory sslContextFactory, InetSocketAddress address);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -712,8 +712,8 @@ public class JettyEmbeddedServletContainerFactory
|
|
|
|
implements SslServerConnectorFactory {
|
|
|
|
implements SslServerConnectorFactory {
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public ServerConnector getConnector(Server server,
|
|
|
|
public ServerConnector createConnector(Server server,
|
|
|
|
SslContextFactory sslContextFactory, int port) {
|
|
|
|
SslContextFactory sslContextFactory, InetSocketAddress address) {
|
|
|
|
HttpConfiguration config = new HttpConfiguration();
|
|
|
|
HttpConfiguration config = new HttpConfiguration();
|
|
|
|
config.setSendServerVersion(false);
|
|
|
|
config.setSendServerVersion(false);
|
|
|
|
config.addCustomizer(new SecureRequestCustomizer());
|
|
|
|
config.addCustomizer(new SecureRequestCustomizer());
|
|
|
@ -722,7 +722,8 @@ public class JettyEmbeddedServletContainerFactory
|
|
|
|
sslContextFactory, HttpVersion.HTTP_1_1.asString());
|
|
|
|
sslContextFactory, HttpVersion.HTTP_1_1.asString());
|
|
|
|
ServerConnector serverConnector = new ServerConnector(server,
|
|
|
|
ServerConnector serverConnector = new ServerConnector(server,
|
|
|
|
sslConnectionFactory, connectionFactory);
|
|
|
|
sslConnectionFactory, connectionFactory);
|
|
|
|
serverConnector.setPort(port);
|
|
|
|
serverConnector.setPort(address.getPort());
|
|
|
|
|
|
|
|
serverConnector.setHost(address.getHostString());
|
|
|
|
return serverConnector;
|
|
|
|
return serverConnector;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -735,8 +736,8 @@ public class JettyEmbeddedServletContainerFactory
|
|
|
|
implements SslServerConnectorFactory {
|
|
|
|
implements SslServerConnectorFactory {
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public AbstractConnector getConnector(Server server,
|
|
|
|
public AbstractConnector createConnector(Server server,
|
|
|
|
SslContextFactory sslContextFactory, int port) {
|
|
|
|
SslContextFactory sslContextFactory, InetSocketAddress address) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
Class<?> connectorClass = Class
|
|
|
|
Class<?> connectorClass = Class
|
|
|
|
.forName("org.eclipse.jetty.server.ssl.SslSocketConnector");
|
|
|
|
.forName("org.eclipse.jetty.server.ssl.SslSocketConnector");
|
|
|
@ -744,7 +745,9 @@ public class JettyEmbeddedServletContainerFactory
|
|
|
|
.getConstructor(SslContextFactory.class)
|
|
|
|
.getConstructor(SslContextFactory.class)
|
|
|
|
.newInstance(sslContextFactory);
|
|
|
|
.newInstance(sslContextFactory);
|
|
|
|
connector.getClass().getMethod("setPort", int.class).invoke(connector,
|
|
|
|
connector.getClass().getMethod("setPort", int.class).invoke(connector,
|
|
|
|
port);
|
|
|
|
address.getPort());
|
|
|
|
|
|
|
|
connector.getClass().getMethod("setHost", String.class).invoke(connector,
|
|
|
|
|
|
|
|
address.getHostString());
|
|
|
|
return connector;
|
|
|
|
return connector;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Exception ex) {
|
|
|
|
catch (Exception ex) {
|
|
|
|