diff --git a/spring-boot-samples/pom.xml b/spring-boot-samples/pom.xml
index 4c0aaecd61a..b74248f5956 100644
--- a/spring-boot-samples/pom.xml
+++ b/spring-boot-samples/pom.xml
@@ -41,7 +41,9 @@
spring-boot-sample-jersey
spring-boot-sample-jersey1
spring-boot-sample-jetty
+ spring-boot-sample-jetty-ssl
spring-boot-sample-jetty8
+ spring-boot-sample-jetty8-ssl
spring-boot-sample-jta-atomikos
spring-boot-sample-jta-bitronix
spring-boot-sample-jta-jndi
diff --git a/spring-boot-samples/spring-boot-sample-jetty-ssl/pom.xml b/spring-boot-samples/spring-boot-sample-jetty-ssl/pom.xml
new file mode 100644
index 00000000000..9d822169bfd
--- /dev/null
+++ b/spring-boot-samples/spring-boot-sample-jetty-ssl/pom.xml
@@ -0,0 +1,53 @@
+
+
+ 4.0.0
+
+
+ org.springframework.boot
+ spring-boot-samples
+ 1.2.0.BUILD-SNAPSHOT
+
+ spring-boot-sample-jetty-ssl
+ Spring Boot Jetty SSL Sample
+ Spring Boot Jetty SSL Sample
+ http://projects.spring.io/spring-boot/
+
+ Pivotal Software, Inc.
+ http://www.spring.io
+
+
+ ${basedir}/../..
+
+
+
+ org.springframework.boot
+ spring-boot-starter
+
+
+ org.springframework.boot
+ spring-boot-starter-jetty
+
+
+ org.springframework
+ spring-webmvc
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+ org.apache.httpcomponents
+ httpclient
+ test
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+
+
+
diff --git a/spring-boot-samples/spring-boot-sample-jetty-ssl/src/main/java/sample/jetty/SampleJettySslApplication.java b/spring-boot-samples/spring-boot-sample-jetty-ssl/src/main/java/sample/jetty/SampleJettySslApplication.java
new file mode 100644
index 00000000000..8953530d686
--- /dev/null
+++ b/spring-boot-samples/spring-boot-sample-jetty-ssl/src/main/java/sample/jetty/SampleJettySslApplication.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2012-2013 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package sample.jetty;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class SampleJettySslApplication {
+
+ public static void main(String[] args) throws Exception {
+ SpringApplication.run(SampleJettySslApplication.class, args);
+ }
+
+}
diff --git a/spring-boot-samples/spring-boot-sample-jetty-ssl/src/main/java/sample/jetty/service/HelloWorldService.java b/spring-boot-samples/spring-boot-sample-jetty-ssl/src/main/java/sample/jetty/service/HelloWorldService.java
new file mode 100644
index 00000000000..3fe540e33e5
--- /dev/null
+++ b/spring-boot-samples/spring-boot-sample-jetty-ssl/src/main/java/sample/jetty/service/HelloWorldService.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2012-2013 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package sample.jetty.service;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+@Component
+public class HelloWorldService {
+
+ @Value("${name:World}")
+ private String name;
+
+ public String getHelloMessage() {
+ return "Hello " + this.name;
+ }
+
+}
diff --git a/spring-boot-samples/spring-boot-sample-jetty-ssl/src/main/java/sample/jetty/web/SampleController.java b/spring-boot-samples/spring-boot-sample-jetty-ssl/src/main/java/sample/jetty/web/SampleController.java
new file mode 100644
index 00000000000..d3eb1f70a9a
--- /dev/null
+++ b/spring-boot-samples/spring-boot-sample-jetty-ssl/src/main/java/sample/jetty/web/SampleController.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2012-2013 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package sample.jetty.web;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import sample.jetty.service.HelloWorldService;
+
+@Controller
+public class SampleController {
+
+ @Autowired
+ private HelloWorldService helloWorldService;
+
+ @RequestMapping("/")
+ @ResponseBody
+ public String helloWorld() {
+ return this.helloWorldService.getHelloMessage();
+ }
+}
diff --git a/spring-boot-samples/spring-boot-sample-jetty-ssl/src/main/resources/application.properties b/spring-boot-samples/spring-boot-sample-jetty-ssl/src/main/resources/application.properties
new file mode 100644
index 00000000000..953abe0d6c9
--- /dev/null
+++ b/spring-boot-samples/spring-boot-sample-jetty-ssl/src/main/resources/application.properties
@@ -0,0 +1,4 @@
+server.port = 8443
+server.ssl.key-store = classpath:sample.jks
+server.ssl.key-store-password = secret
+server.ssl.key-password = password
\ No newline at end of file
diff --git a/spring-boot-samples/spring-boot-sample-jetty-ssl/src/main/resources/sample.jks b/spring-boot-samples/spring-boot-sample-jetty-ssl/src/main/resources/sample.jks
new file mode 100644
index 00000000000..6aa9a28053a
Binary files /dev/null and b/spring-boot-samples/spring-boot-sample-jetty-ssl/src/main/resources/sample.jks differ
diff --git a/spring-boot-samples/spring-boot-sample-jetty-ssl/src/test/java/sample/jetty/SampleJettySslApplicationTests.java b/spring-boot-samples/spring-boot-sample-jetty-ssl/src/test/java/sample/jetty/SampleJettySslApplicationTests.java
new file mode 100644
index 00000000000..a682ed4e2ce
--- /dev/null
+++ b/spring-boot-samples/spring-boot-sample-jetty-ssl/src/test/java/sample/jetty/SampleJettySslApplicationTests.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2012-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package sample.jetty;
+
+import org.apache.http.client.HttpClient;
+import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.conn.ssl.SSLContextBuilder;
+import org.apache.http.conn.ssl.TrustSelfSignedStrategy;
+import org.apache.http.impl.client.HttpClients;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.test.IntegrationTest;
+import org.springframework.boot.test.SpringApplicationConfiguration;
+import org.springframework.boot.test.TestRestTemplate;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
+import org.springframework.test.annotation.DirtiesContext;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import org.springframework.test.context.web.WebAppConfiguration;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Basic integration tests for demo application.
+ *
+ * @author Dave Syer
+ */
+@RunWith(SpringJUnit4ClassRunner.class)
+@SpringApplicationConfiguration(classes = SampleJettySslApplication.class)
+@WebAppConfiguration
+@IntegrationTest("server.port:0")
+@DirtiesContext
+public class SampleJettySslApplicationTests {
+
+ @Value("${local.server.port}")
+ private int port;
+
+ @Test
+ public void testHome() throws Exception {
+ SSLConnectionSocketFactory socketFactory = new SSLConnectionSocketFactory(
+ new SSLContextBuilder().loadTrustMaterial(null,
+ new TrustSelfSignedStrategy()).build());
+
+ HttpClient httpClient = HttpClients.custom().setSSLSocketFactory(socketFactory)
+ .build();
+
+ TestRestTemplate testRestTemplate = new TestRestTemplate();
+ ((HttpComponentsClientHttpRequestFactory) testRestTemplate.getRequestFactory())
+ .setHttpClient(httpClient);
+ ResponseEntity entity = testRestTemplate.getForEntity(
+ "https://localhost:" + this.port, String.class);
+ assertEquals(HttpStatus.OK, entity.getStatusCode());
+ assertEquals("Hello World", entity.getBody());
+ }
+
+}
diff --git a/spring-boot-samples/spring-boot-sample-jetty8-ssl/pom.xml b/spring-boot-samples/spring-boot-sample-jetty8-ssl/pom.xml
new file mode 100644
index 00000000000..f157d309fe1
--- /dev/null
+++ b/spring-boot-samples/spring-boot-sample-jetty8-ssl/pom.xml
@@ -0,0 +1,56 @@
+
+
+ 4.0.0
+
+
+ org.springframework.boot
+ spring-boot-samples
+ 1.2.0.BUILD-SNAPSHOT
+
+ spring-boot-sample-jetty8-ssl
+ Spring Boot Jetty 8 SSL Sample
+ Spring Boot Jetty 8 SSL Sample
+ http://projects.spring.io/spring-boot/
+
+ Pivotal Software, Inc.
+ http://www.spring.io
+
+
+ ${basedir}/../..
+ 8.1.15.v20140411
+ 2.2.0.v201112011158
+ 3.0.1
+
+
+
+ org.springframework.boot
+ spring-boot-starter
+
+
+ org.springframework.boot
+ spring-boot-starter-jetty
+
+
+ org.springframework
+ spring-webmvc
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+ org.apache.httpcomponents
+ httpclient
+ test
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+
+
+
diff --git a/spring-boot-samples/spring-boot-sample-jetty8-ssl/src/main/java/sample/jetty/SampleJetty8SslApplication.java b/spring-boot-samples/spring-boot-sample-jetty8-ssl/src/main/java/sample/jetty/SampleJetty8SslApplication.java
new file mode 100644
index 00000000000..a548f27b4cc
--- /dev/null
+++ b/spring-boot-samples/spring-boot-sample-jetty8-ssl/src/main/java/sample/jetty/SampleJetty8SslApplication.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2012-2013 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package sample.jetty;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class SampleJetty8SslApplication {
+
+ public static void main(String[] args) throws Exception {
+ SpringApplication.run(SampleJetty8SslApplication.class, args);
+ }
+
+}
diff --git a/spring-boot-samples/spring-boot-sample-jetty8-ssl/src/main/java/sample/jetty/service/HelloWorldService.java b/spring-boot-samples/spring-boot-sample-jetty8-ssl/src/main/java/sample/jetty/service/HelloWorldService.java
new file mode 100644
index 00000000000..3fe540e33e5
--- /dev/null
+++ b/spring-boot-samples/spring-boot-sample-jetty8-ssl/src/main/java/sample/jetty/service/HelloWorldService.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2012-2013 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package sample.jetty.service;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+@Component
+public class HelloWorldService {
+
+ @Value("${name:World}")
+ private String name;
+
+ public String getHelloMessage() {
+ return "Hello " + this.name;
+ }
+
+}
diff --git a/spring-boot-samples/spring-boot-sample-jetty8-ssl/src/main/java/sample/jetty/web/SampleController.java b/spring-boot-samples/spring-boot-sample-jetty8-ssl/src/main/java/sample/jetty/web/SampleController.java
new file mode 100644
index 00000000000..d3eb1f70a9a
--- /dev/null
+++ b/spring-boot-samples/spring-boot-sample-jetty8-ssl/src/main/java/sample/jetty/web/SampleController.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2012-2013 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package sample.jetty.web;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import sample.jetty.service.HelloWorldService;
+
+@Controller
+public class SampleController {
+
+ @Autowired
+ private HelloWorldService helloWorldService;
+
+ @RequestMapping("/")
+ @ResponseBody
+ public String helloWorld() {
+ return this.helloWorldService.getHelloMessage();
+ }
+}
diff --git a/spring-boot-samples/spring-boot-sample-jetty8-ssl/src/main/resources/application.properties b/spring-boot-samples/spring-boot-sample-jetty8-ssl/src/main/resources/application.properties
new file mode 100644
index 00000000000..953abe0d6c9
--- /dev/null
+++ b/spring-boot-samples/spring-boot-sample-jetty8-ssl/src/main/resources/application.properties
@@ -0,0 +1,4 @@
+server.port = 8443
+server.ssl.key-store = classpath:sample.jks
+server.ssl.key-store-password = secret
+server.ssl.key-password = password
\ No newline at end of file
diff --git a/spring-boot-samples/spring-boot-sample-jetty8-ssl/src/main/resources/sample.jks b/spring-boot-samples/spring-boot-sample-jetty8-ssl/src/main/resources/sample.jks
new file mode 100644
index 00000000000..6aa9a28053a
Binary files /dev/null and b/spring-boot-samples/spring-boot-sample-jetty8-ssl/src/main/resources/sample.jks differ
diff --git a/spring-boot-samples/spring-boot-sample-jetty8-ssl/src/test/java/sample/jetty/SampleJetty8SslApplicationTests.java b/spring-boot-samples/spring-boot-sample-jetty8-ssl/src/test/java/sample/jetty/SampleJetty8SslApplicationTests.java
new file mode 100644
index 00000000000..8ac26477e09
--- /dev/null
+++ b/spring-boot-samples/spring-boot-sample-jetty8-ssl/src/test/java/sample/jetty/SampleJetty8SslApplicationTests.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2012-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package sample.jetty;
+
+import org.apache.http.client.HttpClient;
+import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.conn.ssl.SSLContextBuilder;
+import org.apache.http.conn.ssl.TrustSelfSignedStrategy;
+import org.apache.http.impl.client.HttpClients;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.test.IntegrationTest;
+import org.springframework.boot.test.SpringApplicationConfiguration;
+import org.springframework.boot.test.TestRestTemplate;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
+import org.springframework.test.annotation.DirtiesContext;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import org.springframework.test.context.web.WebAppConfiguration;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Basic integration tests for demo application.
+ *
+ * @author Dave Syer
+ */
+@RunWith(SpringJUnit4ClassRunner.class)
+@SpringApplicationConfiguration(classes = SampleJetty8SslApplication.class)
+@WebAppConfiguration
+@IntegrationTest("server.port:0")
+@DirtiesContext
+public class SampleJetty8SslApplicationTests {
+
+ @Value("${local.server.port}")
+ private int port;
+
+ @Test
+ public void testHome() throws Exception {
+ SSLConnectionSocketFactory socketFactory = new SSLConnectionSocketFactory(
+ new SSLContextBuilder().loadTrustMaterial(null,
+ new TrustSelfSignedStrategy()).build());
+
+ HttpClient httpClient = HttpClients.custom().setSSLSocketFactory(socketFactory)
+ .build();
+
+ TestRestTemplate testRestTemplate = new TestRestTemplate();
+ ((HttpComponentsClientHttpRequestFactory) testRestTemplate.getRequestFactory())
+ .setHttpClient(httpClient);
+ ResponseEntity entity = testRestTemplate.getForEntity(
+ "https://localhost:" + this.port, String.class);
+ assertEquals(HttpStatus.OK, entity.getStatusCode());
+ assertEquals("Hello World", entity.getBody());
+ }
+
+}
diff --git a/spring-boot-samples/spring-boot-sample-jetty8/src/test/java/sample/jetty/SampleJettyApplicationTests.java b/spring-boot-samples/spring-boot-sample-jetty8/src/test/java/sample/jetty/SampleJetty8ApplicationTests.java
similarity index 97%
rename from spring-boot-samples/spring-boot-sample-jetty8/src/test/java/sample/jetty/SampleJettyApplicationTests.java
rename to spring-boot-samples/spring-boot-sample-jetty8/src/test/java/sample/jetty/SampleJetty8ApplicationTests.java
index abe3f2f996b..535df112179 100644
--- a/spring-boot-samples/spring-boot-sample-jetty8/src/test/java/sample/jetty/SampleJettyApplicationTests.java
+++ b/spring-boot-samples/spring-boot-sample-jetty8/src/test/java/sample/jetty/SampleJetty8ApplicationTests.java
@@ -40,7 +40,7 @@ import static org.junit.Assert.assertEquals;
@WebAppConfiguration
@IntegrationTest("server.port:0")
@DirtiesContext
-public class SampleJettyApplicationTests {
+public class SampleJetty8ApplicationTests {
@Value("${local.server.port}")
private int port;
diff --git a/spring-boot/src/main/java/org/springframework/boot/context/embedded/jetty/JettyEmbeddedServletContainerFactory.java b/spring-boot/src/main/java/org/springframework/boot/context/embedded/jetty/JettyEmbeddedServletContainerFactory.java
index ac9826be924..9fb837f0a64 100644
--- a/spring-boot/src/main/java/org/springframework/boot/context/embedded/jetty/JettyEmbeddedServletContainerFactory.java
+++ b/spring-boot/src/main/java/org/springframework/boot/context/embedded/jetty/JettyEmbeddedServletContainerFactory.java
@@ -27,6 +27,7 @@ import java.util.List;
import org.eclipse.jetty.http.HttpVersion;
import org.eclipse.jetty.http.MimeTypes;
+import org.eclipse.jetty.server.AbstractConnector;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.HttpConnectionFactory;
import org.eclipse.jetty.server.Server;
@@ -120,9 +121,8 @@ public class JettyEmbeddedServletContainerFactory extends
if (getSsl() != null) {
SslContextFactory sslContextFactory = new SslContextFactory();
configureSsl(sslContextFactory, getSsl());
- ServerConnector connector = getSslServerConnectorFactory().getConnector(
- server, sslContextFactory);
- connector.setPort(port);
+ AbstractConnector connector = getSslServerConnectorFactory().getConnector(
+ server, sslContextFactory, port);
server.setConnectors(new Connector[] { connector });
}
@@ -473,7 +473,8 @@ public class JettyEmbeddedServletContainerFactory extends
*/
private static interface SslServerConnectorFactory {
- ServerConnector getConnector(Server server, SslContextFactory sslContextFactory);
+ AbstractConnector getConnector(Server server,
+ SslContextFactory sslContextFactory, int port);
}
@@ -485,10 +486,12 @@ public class JettyEmbeddedServletContainerFactory extends
@Override
public ServerConnector getConnector(Server server,
- SslContextFactory sslContextFactory) {
- return new ServerConnector(server, new SslConnectionFactory(
- sslContextFactory, HttpVersion.HTTP_1_1.asString()),
- new HttpConnectionFactory());
+ SslContextFactory sslContextFactory, int port) {
+ ServerConnector serverConnector = new ServerConnector(server,
+ new SslConnectionFactory(sslContextFactory,
+ HttpVersion.HTTP_1_1.asString()), new HttpConnectionFactory());
+ serverConnector.setPort(port);
+ return serverConnector;
}
}
@@ -499,13 +502,17 @@ public class JettyEmbeddedServletContainerFactory extends
SslServerConnectorFactory {
@Override
- public ServerConnector getConnector(Server server,
- SslContextFactory sslContextFactory) {
+ public AbstractConnector getConnector(Server server,
+ SslContextFactory sslContextFactory, int port) {
try {
Class> connectorClass = Class
.forName("org.eclipse.jetty.server.ssl.SslSocketConnector");
- return (ServerConnector) connectorClass.getConstructor(
- SslContextFactory.class).newInstance(sslContextFactory);
+ AbstractConnector connector = (AbstractConnector) connectorClass
+ .getConstructor(SslContextFactory.class).newInstance(
+ sslContextFactory);
+ connector.getClass().getMethod("setPort", int.class)
+ .invoke(connector, port);
+ return connector;
}
catch (Exception ex) {
throw new IllegalStateException(ex);