From 9cc19fd57613701716dad1d4d793b4be92dc3c4a Mon Sep 17 00:00:00 2001 From: valb3r Date: Sun, 6 Aug 2023 10:58:50 +0300 Subject: [PATCH 1/3] Fixes for Spring 3.1+ --- build.gradle | 4 +- ...ownLetsEncryptChallengeEndpointConfig.java | 51 +++++++++++++++---- 2 files changed, 42 insertions(+), 13 deletions(-) diff --git a/build.gradle b/build.gradle index e4c36fe..9aa4763 100644 --- a/build.gradle +++ b/build.gradle @@ -8,8 +8,8 @@ repositories { } ext { - spring = '6.0.3' - springBoot = '3.0.5' + spring = '6.0.9' + springBoot = '3.1.0' acme4j = '2.16' tomcatEmbed = '10.1.7' jettyEmbed = '11.0.14' diff --git a/tomcat/src/main/java/com/github/valb3r/letsencrypthelper/tomcat/TomcatWellKnownLetsEncryptChallengeEndpointConfig.java b/tomcat/src/main/java/com/github/valb3r/letsencrypthelper/tomcat/TomcatWellKnownLetsEncryptChallengeEndpointConfig.java index f72ef04..16d0283 100644 --- a/tomcat/src/main/java/com/github/valb3r/letsencrypthelper/tomcat/TomcatWellKnownLetsEncryptChallengeEndpointConfig.java +++ b/tomcat/src/main/java/com/github/valb3r/letsencrypthelper/tomcat/TomcatWellKnownLetsEncryptChallengeEndpointConfig.java @@ -110,6 +110,9 @@ public class TomcatWellKnownLetsEncryptChallengeEndpointConfig implements Tomcat private final List observedProtocols = new CopyOnWriteArrayList<>(); private final AtomicBoolean customized = new AtomicBoolean(); + // Internal + private SSLHostConfig sslHostConfig; + /** * Initialize LetsEncrypt certificate obtaining and renewal class. * @param serverProperties - SSL properties (serverProperties.ssl) to be used @@ -199,9 +202,11 @@ public void customize(Connector connector) { return; } + this.sslHostConfig = sslConfig; + createBasicKeystoreIfMissing(); - TargetProtocol observe = createObservableProtocol(protocol, sslConfig); + TargetProtocol observe = createObservableProtocol(protocol); if (observe == null) { return; } @@ -244,20 +249,42 @@ WebServerFactoryCustomizer servletContainer() { }; } + @Configuration + public static class CustomTomcatServletWebServerFactoryCustomizer + implements WebServerFactoryCustomizer { + + private final TomcatWellKnownLetsEncryptChallengeEndpointConfig challengeEndpointConfig; + + public CustomTomcatServletWebServerFactoryCustomizer(TomcatWellKnownLetsEncryptChallengeEndpointConfig challengeEndpointConfig) { + this.challengeEndpointConfig = challengeEndpointConfig; + } + + // For Spring Boot 3.1+ forcefully creating empty keystore if does not exist due to SslConnectorCustomizer + @Override + public void customize(TomcatServletWebServerFactory factory) { + challengeEndpointConfig.createBasicKeystoreIfMissing(); + } + } + protected Instant getNow() { return Instant.now(); } protected boolean matchesCertFilePathAndPassword(SSLHostConfig config, String password) { - // Spring Boot 3+ + // Spring Boot 3.1+ Hacketty here + return null != findMatchingCertificate(config, password); + } + + protected SSLHostConfigCertificate findMatchingCertificate(SSLHostConfig config, String password) { if (null != config.getCertificates()) { return config.getCertificates().stream() - .filter(it -> null != it.getCertificateKeystoreFile()) - .filter(it -> it.getCertificateKeystoreFile().contains(serverProperties.getSsl().getKeyStore())) - .anyMatch(it -> password.equals(it.getCertificateKeystorePassword())); + .filter(it -> null != it.getCertificateKeyAlias()) + .filter(it -> it.getCertificateKeyAlias().equals(config.getCertificates().stream().findFirst().get().getCertificateKeyAlias())) + .filter(it -> password.equals(it.getCertificateKeystorePassword())) + .findFirst().orElse(null); } - return false; + return null; } private void createBasicKeystoreIfMissing() { @@ -276,8 +303,8 @@ private void createBasicKeystoreIfMissing() { logger.info("Created basic (dummy cert, real account/domain keys) KeyStore: {}", keystoreFile.getAbsolutePath()); } - private TargetProtocol createObservableProtocol(AbstractHttp11Protocol protocol, SSLHostConfig sslConfig) { - var observe = new TargetProtocol(sslConfig, protocol); + private TargetProtocol createObservableProtocol(AbstractHttp11Protocol protocol) { + var observe = new TargetProtocol(sslHostConfig, protocol); var ks = tryToReadKeystore(); var cert = tryToReadCertificate(observe, ks); if (null == cert) { @@ -285,7 +312,7 @@ private TargetProtocol createObservableProtocol(AbstractHttp11Protocol protoc "For Protocol {}:{} unable to read certificate from {}", protocol.getClass().getCanonicalName(), protocol.getPort(), - sslConfig.getCertificates().stream().map(SSLHostConfigCertificate::getCertificateKeystoreFile).collect(Collectors.toList()) + sslHostConfig.getCertificates().stream().map(SSLHostConfigCertificate::getCertificateKeystoreFile).collect(Collectors.toList()) ); return null; } @@ -345,7 +372,9 @@ private void executeCheckCertValidityAndRotateIfNeeded() { } try { - updateCertificateAndKeystore(ks); + updateKeystoreAndSave(ks); + var certificate = findMatchingCertificate(sslHostConfig, keyPassword()); + certificate.setCertificateKeystore(ks); // Since Spring 3.1 KeyStore is used instead of Keystore file protocol.getProtocol().reloadSslHostConfigs(); } catch (RuntimeException ex) { logger.warn("Failed updating KeyStore", ex); @@ -393,7 +422,7 @@ private Certificate selfSign(KeyPair keyPair, Instant notBefore, Instant notAfte } - private void updateCertificateAndKeystore(KeyStore ks) { + private void updateKeystoreAndSave(KeyStore ks) { Session session = new Session(letsEncryptServer); URI tos; try { From 2c0bcbb803b6b35432b3ea15919f4709115581fa Mon Sep 17 00:00:00 2001 From: valb3r Date: Sat, 12 Aug 2023 13:53:05 +0300 Subject: [PATCH 2/3] Fixes for Spring 3.1+ --- ...ownLetsEncryptChallengeEndpointConfig.java | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/jetty/src/main/java/com/github/valb3r/letsencrypthelper/jetty/JettyWellKnownLetsEncryptChallengeEndpointConfig.java b/jetty/src/main/java/com/github/valb3r/letsencrypthelper/jetty/JettyWellKnownLetsEncryptChallengeEndpointConfig.java index bdd480a..587cc6f 100644 --- a/jetty/src/main/java/com/github/valb3r/letsencrypthelper/jetty/JettyWellKnownLetsEncryptChallengeEndpointConfig.java +++ b/jetty/src/main/java/com/github/valb3r/letsencrypthelper/jetty/JettyWellKnownLetsEncryptChallengeEndpointConfig.java @@ -36,6 +36,7 @@ import org.springframework.boot.context.event.ApplicationReadyEvent; import org.springframework.boot.web.embedded.jetty.ConfigurableJettyWebServerFactory; import org.springframework.boot.web.embedded.jetty.JettyServerCustomizer; +import org.springframework.boot.web.embedded.jetty.JettyServletWebServerFactory; import org.springframework.boot.web.server.WebServerFactoryCustomizer; import org.springframework.context.ApplicationListener; import org.springframework.context.annotation.Bean; @@ -71,7 +72,6 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.atomic.AtomicBoolean; -import java.util.stream.Collectors; /** * This configuration class is responsible for maintaining KeyStore with LetsEncrypt certificates. @@ -191,7 +191,7 @@ public void customize(Server server) { continue; } var ctx = factory.getSslContextFactory(); - if (!ctx.getKeyStorePath().contains(serverProperties.getSsl().getKeyStore()) + if (!ctx.getKeyStorePassword().equals(serverProperties.getSsl().getKeyStorePassword()) || !ctx.getCertAlias().equals(serverProperties.getSsl().getKeyAlias())) { continue; } @@ -245,6 +245,23 @@ WebServerFactoryCustomizer servletContainer() }; } + @Configuration + public static class CustomTomcatServletWebServerFactoryCustomizer + implements WebServerFactoryCustomizer { + + private final JettyWellKnownLetsEncryptChallengeEndpointConfig challengeEndpointConfig; + + public CustomTomcatServletWebServerFactoryCustomizer(JettyWellKnownLetsEncryptChallengeEndpointConfig challengeEndpointConfig) { + this.challengeEndpointConfig = challengeEndpointConfig; + } + + // For Spring Boot 3.1+ forcefully creating empty keystore if does not exist due to SslConnectorCustomizer + @Override + public void customize(JettyServletWebServerFactory factory) { + challengeEndpointConfig.createBasicKeystoreIfMissing(); + } + } + protected Instant getNow() { return Instant.now(); } @@ -337,7 +354,9 @@ private void executeCheckCertValidityAndRotateIfNeeded() { try { updateCertificateAndKeystore(ks); - endpoint.getSslContextFactory().reload(it -> {}); + endpoint.getSslContextFactory().reload(it -> { + it.setKeyStore(ks); + }); } catch (Exception ex) { logger.warn("Failed updating KeyStore", ex); } From c72d0b3879f7c2f2462a3980bac787a04a21ab7b Mon Sep 17 00:00:00 2001 From: valb3r Date: Sat, 12 Aug 2023 14:52:11 +0300 Subject: [PATCH 3/3] Tests for Spring Boot 3.0 --- build.gradle | 4 +-- jetty/tests-spring-3.0/build.gradle | 34 +++++++++++++++++++ .../jetty/DisableJettySniConfig.java | 24 +++++++++++++ .../jetty/JettyExpiredKeyPebbleTest.java | 8 +++++ .../jetty/JettyNoKeystorePebbleTest.java | 8 +++++ .../JettyNotExpiredKeystorePebbleTest.java | 8 +++++ .../jetty/dummyapp/DummyApp.java | 15 ++++++++ settings.gradle | 2 ++ tomcat/tests-spring-3.0/build.gradle | 24 +++++++++++++ .../tomcat/TomcatExpiredKeyPebbleTest.java | 6 ++++ .../tomcat/TomcatNoKeystorePebbleTest.java | 6 ++++ .../TomcatNotExpiredKeystorePebbleTest.java | 6 ++++ .../tomcat/dummyapp/DummyApp.java | 15 ++++++++ tomcat/tests-spring-3.2-m1/build.gradle | 25 ++++++++++++++ .../tomcat/TomcatExpiredKeyPebbleTest.java | 6 ++++ .../tomcat/TomcatNoKeystorePebbleTest.java | 6 ++++ .../TomcatNotExpiredKeystorePebbleTest.java | 6 ++++ .../tomcat/dummyapp/DummyApp.java | 15 ++++++++ 18 files changed, 216 insertions(+), 2 deletions(-) create mode 100644 jetty/tests-spring-3.0/build.gradle create mode 100644 jetty/tests-spring-3.0/src/test/java/com/github/valb3r/letsencrypthelper/jetty/DisableJettySniConfig.java create mode 100644 jetty/tests-spring-3.0/src/test/java/com/github/valb3r/letsencrypthelper/jetty/JettyExpiredKeyPebbleTest.java create mode 100644 jetty/tests-spring-3.0/src/test/java/com/github/valb3r/letsencrypthelper/jetty/JettyNoKeystorePebbleTest.java create mode 100644 jetty/tests-spring-3.0/src/test/java/com/github/valb3r/letsencrypthelper/jetty/JettyNotExpiredKeystorePebbleTest.java create mode 100644 jetty/tests-spring-3.0/src/test/java/com/github/valb3r/letsencrypthelper/jetty/dummyapp/DummyApp.java create mode 100644 tomcat/tests-spring-3.0/build.gradle create mode 100644 tomcat/tests-spring-3.0/src/test/java/com/github/valb3r/letsencrypthelper/tomcat/TomcatExpiredKeyPebbleTest.java create mode 100644 tomcat/tests-spring-3.0/src/test/java/com/github/valb3r/letsencrypthelper/tomcat/TomcatNoKeystorePebbleTest.java create mode 100644 tomcat/tests-spring-3.0/src/test/java/com/github/valb3r/letsencrypthelper/tomcat/TomcatNotExpiredKeystorePebbleTest.java create mode 100644 tomcat/tests-spring-3.0/src/test/java/com/github/valb3r/letsencrypthelper/tomcat/dummyapp/DummyApp.java create mode 100644 tomcat/tests-spring-3.2-m1/build.gradle create mode 100644 tomcat/tests-spring-3.2-m1/src/test/java/com/github/valb3r/letsencrypthelper/tomcat/TomcatExpiredKeyPebbleTest.java create mode 100644 tomcat/tests-spring-3.2-m1/src/test/java/com/github/valb3r/letsencrypthelper/tomcat/TomcatNoKeystorePebbleTest.java create mode 100644 tomcat/tests-spring-3.2-m1/src/test/java/com/github/valb3r/letsencrypthelper/tomcat/TomcatNotExpiredKeystorePebbleTest.java create mode 100644 tomcat/tests-spring-3.2-m1/src/test/java/com/github/valb3r/letsencrypthelper/tomcat/dummyapp/DummyApp.java 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); + } +}