diff --git a/build.gradle b/build.gradle index 9aa4763..54174d6 100644 --- a/build.gradle +++ b/build.gradle @@ -8,8 +8,8 @@ repositories { } ext { - spring = '6.0.9' - springBoot = '3.1.0' + spring = '6.0.11' + springBoot = '3.1.2' acme4j = '2.16' tomcatEmbed = '10.1.7' jettyEmbed = '11.0.14' diff --git a/jetty/tests-spring-3.0/build.gradle b/jetty/tests-spring-3.0/build.gradle new file mode 100644 index 0000000..0f26272 --- /dev/null +++ b/jetty/tests-spring-3.0/build.gradle @@ -0,0 +1,34 @@ +plugins { + id 'java' +} + +repositories { + mavenCentral() +} + +dependencies { + testImplementation project(":jetty") + testImplementation project(":tests-common") + + testImplementation ("org.springframework.boot:spring-boot-starter-web:3.0.0") { + exclude module: 'spring-boot-starter-tomcat' + } + testImplementation "org.springframework.boot:spring-boot-starter-jetty:3.0.0" + testImplementation "org.springframework.boot:spring-boot-starter-test:3.0.0" + // See https://github.com/spring-projects/spring-boot/issues/33044 for details + testImplementation('jakarta.servlet:jakarta.servlet-api') { + version { + strictly '5.0.0' + because "Jetty 11 does not support Servlet 6 yet" + } + } + + testImplementation "org.awaitility:awaitility:$awaitability" + testImplementation "org.junit.jupiter:junit-jupiter-engine:$jupiter" + testImplementation "org.testcontainers:junit-jupiter:$testContainers" + testImplementation "org.assertj:assertj-core:$assertj" +} + +test { + useJUnitPlatform() +} diff --git a/jetty/tests-spring-3.0/src/test/java/com/github/valb3r/letsencrypthelper/jetty/DisableJettySniConfig.java b/jetty/tests-spring-3.0/src/test/java/com/github/valb3r/letsencrypthelper/jetty/DisableJettySniConfig.java new file mode 100644 index 0000000..690abd8 --- /dev/null +++ b/jetty/tests-spring-3.0/src/test/java/com/github/valb3r/letsencrypthelper/jetty/DisableJettySniConfig.java @@ -0,0 +1,24 @@ +package com.github.valb3r.letsencrypthelper.jetty; + +import org.eclipse.jetty.server.HttpConnectionFactory; +import org.eclipse.jetty.server.SecureRequestCustomizer; +import org.eclipse.jetty.server.Server; +import org.springframework.boot.web.embedded.jetty.JettyServerCustomizer; +import org.springframework.context.annotation.Configuration; + +import java.util.Arrays; + +@Configuration +public class DisableJettySniConfig implements JettyServerCustomizer { + + @Override + public void customize(Server server) { + Arrays.stream(server.getConnectors()) + .forEach( + connector -> connector.getConnectionFactory(HttpConnectionFactory.class) + .getHttpConfiguration() + .getCustomizer(SecureRequestCustomizer.class) + .setSniHostCheck(false) + ); + } +} diff --git a/jetty/tests-spring-3.0/src/test/java/com/github/valb3r/letsencrypthelper/jetty/JettyExpiredKeyPebbleTest.java b/jetty/tests-spring-3.0/src/test/java/com/github/valb3r/letsencrypthelper/jetty/JettyExpiredKeyPebbleTest.java new file mode 100644 index 0000000..62a5291 --- /dev/null +++ b/jetty/tests-spring-3.0/src/test/java/com/github/valb3r/letsencrypthelper/jetty/JettyExpiredKeyPebbleTest.java @@ -0,0 +1,8 @@ +package com.github.valb3r.letsencrypthelper.jetty; + +import com.github.valb3r.letsencrypthelper.ExpiredKeyPebbleTest; +import org.springframework.context.annotation.Import; + +@Import(DisableJettySniConfig.class) +class JettyExpiredKeyPebbleTest extends ExpiredKeyPebbleTest { +} diff --git a/jetty/tests-spring-3.0/src/test/java/com/github/valb3r/letsencrypthelper/jetty/JettyNoKeystorePebbleTest.java b/jetty/tests-spring-3.0/src/test/java/com/github/valb3r/letsencrypthelper/jetty/JettyNoKeystorePebbleTest.java new file mode 100644 index 0000000..eac2376 --- /dev/null +++ b/jetty/tests-spring-3.0/src/test/java/com/github/valb3r/letsencrypthelper/jetty/JettyNoKeystorePebbleTest.java @@ -0,0 +1,8 @@ +package com.github.valb3r.letsencrypthelper.jetty; + +import com.github.valb3r.letsencrypthelper.NoKeystorePebbleTest; +import org.springframework.context.annotation.Import; + +@Import(DisableJettySniConfig.class) +class JettyNoKeystorePebbleTest extends NoKeystorePebbleTest { +} diff --git a/jetty/tests-spring-3.0/src/test/java/com/github/valb3r/letsencrypthelper/jetty/JettyNotExpiredKeystorePebbleTest.java b/jetty/tests-spring-3.0/src/test/java/com/github/valb3r/letsencrypthelper/jetty/JettyNotExpiredKeystorePebbleTest.java new file mode 100644 index 0000000..75f1422 --- /dev/null +++ b/jetty/tests-spring-3.0/src/test/java/com/github/valb3r/letsencrypthelper/jetty/JettyNotExpiredKeystorePebbleTest.java @@ -0,0 +1,8 @@ +package com.github.valb3r.letsencrypthelper.jetty; + +import com.github.valb3r.letsencrypthelper.NotExpiredKeystorePebbleTest; +import org.springframework.context.annotation.Import; + +@Import(DisableJettySniConfig.class) +class JettyNotExpiredKeystorePebbleTest extends NotExpiredKeystorePebbleTest { +} diff --git a/jetty/tests-spring-3.0/src/test/java/com/github/valb3r/letsencrypthelper/jetty/dummyapp/DummyApp.java b/jetty/tests-spring-3.0/src/test/java/com/github/valb3r/letsencrypthelper/jetty/dummyapp/DummyApp.java new file mode 100644 index 0000000..d3041ea --- /dev/null +++ b/jetty/tests-spring-3.0/src/test/java/com/github/valb3r/letsencrypthelper/jetty/dummyapp/DummyApp.java @@ -0,0 +1,15 @@ +package com.github.valb3r.letsencrypthelper.jetty.dummyapp; + +import com.github.valb3r.letsencrypthelper.jetty.JettyWellKnownLetsEncryptChallengeEndpointConfig; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Import; + +@SpringBootApplication +@Import({JettyWellKnownLetsEncryptChallengeEndpointConfig.class}) +public class DummyApp { + + public static void main(String[] args) { + SpringApplication.run(DummyApp.class); + } +} diff --git a/settings.gradle b/settings.gradle index 20d8942..8e3c7ed 100644 --- a/settings.gradle +++ b/settings.gradle @@ -3,6 +3,8 @@ rootProject.name = 'letsencrypt-helper' include 'tomcat' include 'jetty' include 'tests-common' +include 'tomcat:tests-spring-3.0' +include 'jetty:tests-spring-3.0' project(":tomcat").projectDir = file("tomcat") project(":jetty").projectDir = file("jetty") diff --git a/tomcat/tests-spring-3.0/build.gradle b/tomcat/tests-spring-3.0/build.gradle new file mode 100644 index 0000000..dd07959 --- /dev/null +++ b/tomcat/tests-spring-3.0/build.gradle @@ -0,0 +1,24 @@ +plugins { + id 'java' +} + +repositories { + mavenCentral() +} + +dependencies { + testImplementation project(":tomcat") + testImplementation project(":tests-common") + testImplementation "org.springframework.boot:spring-boot-starter-web:3.0.0" + testImplementation "org.springframework.boot:spring-boot-starter-tomcat:3.0.0" + testImplementation "org.springframework.boot:spring-boot-starter-test:3.0.0" + + testImplementation "org.awaitility:awaitility:$awaitability" + testImplementation "org.junit.jupiter:junit-jupiter-engine:$jupiter" + testImplementation "org.testcontainers:junit-jupiter:$testContainers" + testImplementation "org.assertj:assertj-core:$assertj" +} + +test { + useJUnitPlatform() +} diff --git a/tomcat/tests-spring-3.0/src/test/java/com/github/valb3r/letsencrypthelper/tomcat/TomcatExpiredKeyPebbleTest.java b/tomcat/tests-spring-3.0/src/test/java/com/github/valb3r/letsencrypthelper/tomcat/TomcatExpiredKeyPebbleTest.java new file mode 100644 index 0000000..2f61ca1 --- /dev/null +++ b/tomcat/tests-spring-3.0/src/test/java/com/github/valb3r/letsencrypthelper/tomcat/TomcatExpiredKeyPebbleTest.java @@ -0,0 +1,6 @@ +package com.github.valb3r.letsencrypthelper.tomcat; + +import com.github.valb3r.letsencrypthelper.ExpiredKeyPebbleTest; + +class TomcatExpiredKeyPebbleTest extends ExpiredKeyPebbleTest { +} diff --git a/tomcat/tests-spring-3.0/src/test/java/com/github/valb3r/letsencrypthelper/tomcat/TomcatNoKeystorePebbleTest.java b/tomcat/tests-spring-3.0/src/test/java/com/github/valb3r/letsencrypthelper/tomcat/TomcatNoKeystorePebbleTest.java new file mode 100644 index 0000000..ea059c1 --- /dev/null +++ b/tomcat/tests-spring-3.0/src/test/java/com/github/valb3r/letsencrypthelper/tomcat/TomcatNoKeystorePebbleTest.java @@ -0,0 +1,6 @@ +package com.github.valb3r.letsencrypthelper.tomcat; + +import com.github.valb3r.letsencrypthelper.NoKeystorePebbleTest; + +class TomcatNoKeystorePebbleTest extends NoKeystorePebbleTest { +} diff --git a/tomcat/tests-spring-3.0/src/test/java/com/github/valb3r/letsencrypthelper/tomcat/TomcatNotExpiredKeystorePebbleTest.java b/tomcat/tests-spring-3.0/src/test/java/com/github/valb3r/letsencrypthelper/tomcat/TomcatNotExpiredKeystorePebbleTest.java new file mode 100644 index 0000000..92601ca --- /dev/null +++ b/tomcat/tests-spring-3.0/src/test/java/com/github/valb3r/letsencrypthelper/tomcat/TomcatNotExpiredKeystorePebbleTest.java @@ -0,0 +1,6 @@ +package com.github.valb3r.letsencrypthelper.tomcat; + +import com.github.valb3r.letsencrypthelper.NotExpiredKeystorePebbleTest; + +class TomcatNotExpiredKeystorePebbleTest extends NotExpiredKeystorePebbleTest { +} diff --git a/tomcat/tests-spring-3.0/src/test/java/com/github/valb3r/letsencrypthelper/tomcat/dummyapp/DummyApp.java b/tomcat/tests-spring-3.0/src/test/java/com/github/valb3r/letsencrypthelper/tomcat/dummyapp/DummyApp.java new file mode 100644 index 0000000..ac2b659 --- /dev/null +++ b/tomcat/tests-spring-3.0/src/test/java/com/github/valb3r/letsencrypthelper/tomcat/dummyapp/DummyApp.java @@ -0,0 +1,15 @@ +package com.github.valb3r.letsencrypthelper.tomcat.dummyapp; + +import com.github.valb3r.letsencrypthelper.tomcat.TomcatWellKnownLetsEncryptChallengeEndpointConfig; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Import; + +@SpringBootApplication +@Import({TomcatWellKnownLetsEncryptChallengeEndpointConfig.class}) +public class DummyApp { + + public static void main(String[] args) { + SpringApplication.run(DummyApp.class); + } +} diff --git a/tomcat/tests-spring-3.2-m1/build.gradle b/tomcat/tests-spring-3.2-m1/build.gradle new file mode 100644 index 0000000..2733033 --- /dev/null +++ b/tomcat/tests-spring-3.2-m1/build.gradle @@ -0,0 +1,25 @@ +plugins { + id 'java' +} + +repositories { + mavenCentral() + maven { url "https://repo.spring.io/milestone" } +} + +dependencies { + testImplementation project(":tomcat") + testImplementation project(":tests-common") + testImplementation "org.springframework.boot:spring-boot-starter-web:3.2.0-M1" + testImplementation "org.springframework.boot:spring-boot-starter-tomcat:3.2.0-M1" + testImplementation "org.springframework.boot:spring-boot-starter-test:3.2.0-M1" + + testImplementation "org.awaitility:awaitility:$awaitability" + testImplementation "org.junit.jupiter:junit-jupiter-engine:$jupiter" + testImplementation "org.testcontainers:junit-jupiter:1.18.3" + testImplementation "org.assertj:assertj-core:$assertj" +} + +test { + useJUnitPlatform() +} diff --git a/tomcat/tests-spring-3.2-m1/src/test/java/com/github/valb3r/letsencrypthelper/tomcat/TomcatExpiredKeyPebbleTest.java b/tomcat/tests-spring-3.2-m1/src/test/java/com/github/valb3r/letsencrypthelper/tomcat/TomcatExpiredKeyPebbleTest.java new file mode 100644 index 0000000..2f61ca1 --- /dev/null +++ b/tomcat/tests-spring-3.2-m1/src/test/java/com/github/valb3r/letsencrypthelper/tomcat/TomcatExpiredKeyPebbleTest.java @@ -0,0 +1,6 @@ +package com.github.valb3r.letsencrypthelper.tomcat; + +import com.github.valb3r.letsencrypthelper.ExpiredKeyPebbleTest; + +class TomcatExpiredKeyPebbleTest extends ExpiredKeyPebbleTest { +} diff --git a/tomcat/tests-spring-3.2-m1/src/test/java/com/github/valb3r/letsencrypthelper/tomcat/TomcatNoKeystorePebbleTest.java b/tomcat/tests-spring-3.2-m1/src/test/java/com/github/valb3r/letsencrypthelper/tomcat/TomcatNoKeystorePebbleTest.java new file mode 100644 index 0000000..ea059c1 --- /dev/null +++ b/tomcat/tests-spring-3.2-m1/src/test/java/com/github/valb3r/letsencrypthelper/tomcat/TomcatNoKeystorePebbleTest.java @@ -0,0 +1,6 @@ +package com.github.valb3r.letsencrypthelper.tomcat; + +import com.github.valb3r.letsencrypthelper.NoKeystorePebbleTest; + +class TomcatNoKeystorePebbleTest extends NoKeystorePebbleTest { +} diff --git a/tomcat/tests-spring-3.2-m1/src/test/java/com/github/valb3r/letsencrypthelper/tomcat/TomcatNotExpiredKeystorePebbleTest.java b/tomcat/tests-spring-3.2-m1/src/test/java/com/github/valb3r/letsencrypthelper/tomcat/TomcatNotExpiredKeystorePebbleTest.java new file mode 100644 index 0000000..92601ca --- /dev/null +++ b/tomcat/tests-spring-3.2-m1/src/test/java/com/github/valb3r/letsencrypthelper/tomcat/TomcatNotExpiredKeystorePebbleTest.java @@ -0,0 +1,6 @@ +package com.github.valb3r.letsencrypthelper.tomcat; + +import com.github.valb3r.letsencrypthelper.NotExpiredKeystorePebbleTest; + +class TomcatNotExpiredKeystorePebbleTest extends NotExpiredKeystorePebbleTest { +} diff --git a/tomcat/tests-spring-3.2-m1/src/test/java/com/github/valb3r/letsencrypthelper/tomcat/dummyapp/DummyApp.java b/tomcat/tests-spring-3.2-m1/src/test/java/com/github/valb3r/letsencrypthelper/tomcat/dummyapp/DummyApp.java new file mode 100644 index 0000000..ac2b659 --- /dev/null +++ b/tomcat/tests-spring-3.2-m1/src/test/java/com/github/valb3r/letsencrypthelper/tomcat/dummyapp/DummyApp.java @@ -0,0 +1,15 @@ +package com.github.valb3r.letsencrypthelper.tomcat.dummyapp; + +import com.github.valb3r.letsencrypthelper.tomcat.TomcatWellKnownLetsEncryptChallengeEndpointConfig; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Import; + +@SpringBootApplication +@Import({TomcatWellKnownLetsEncryptChallengeEndpointConfig.class}) +public class DummyApp { + + public static void main(String[] args) { + SpringApplication.run(DummyApp.class); + } +}