Skip to content

Commit

Permalink
DOCKER-450 [Update] SSLConfiguration update FOR TomcaT v10 SUPPORT.
Browse files Browse the repository at this point in the history
  • Loading branch information
codingBenVdS committed Apr 29, 2024
1 parent 8a3d5ed commit 7523658
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
9 changes: 7 additions & 2 deletions tomcat-base/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,19 @@ subprojects {
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
// Caused by: java.lang.UnsupportedClassVersionError: org/springframework/web/SpringServletContainerInitializer has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0 (unable to load class [org.springframework.web.SpringServletContainerInitializer])\
// if (tomcatVersion.contains("10")){
// sourceCompatibility = JavaVersion.VERSION_17
// targetCompatibility = JavaVersion.VERSION_17
// }
}
ext {
jsonLoggingVersion = '0.0.7'
}
dependencies {

compileOnly "org.projectlombok:lombok:1.18.28"
annotationProcessor "org.projectlombok:lombok:1.18.28"
compileOnly "org.projectlombok:lombok:1.18.32"
annotationProcessor "org.projectlombok:lombok:1.18.32"

implementation "org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}"
implementation "org.apache.tomcat.embed:tomcat-embed-jasper:${tomcatVersion}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import java.nio.file.Paths;
import java.util.Properties;
import java.util.logging.Logger;
import org.apache.tomcat.util.net.SSLHostConfigCertificate;

public class AlfrescoTomcatFactoryHelper {

Expand Down Expand Up @@ -66,9 +67,16 @@ public static void createSSLConnector(Tomcat tomcat, AlfrescoConfiguration alfre
);

SSLHostConfig sslHostConfig = new SSLHostConfig();
sslHostConfig.setCertificateKeystoreFile(alfrescoConfiguration.getTomcatSSLKeystore());
sslHostConfig.setCertificateKeystorePassword(alfrescoConfiguration.getTomcatSSLKeystorePassword());
sslHostConfig.setCertificateKeystoreType("JCEKS");
// This is deprecated in Tomcat 9 and deleted from Tomcat V10.1!
// sslHostConfig.setCertificateKeystoreFile(alfrescoConfiguration.getTomcatSSLKeystore());
// sslHostConfig.setCertificateKeystorePassword(alfrescoConfiguration.getTomcatSSLKeystorePassword());
// sslHostConfig.setCertificateKeystoreType("JCEKS");
SSLHostConfigCertificate sslHostConfigCertificate = new SSLHostConfigCertificate(sslHostConfig, SSLHostConfigCertificate.Type.UNDEFINED);
sslHostConfigCertificate.setCertificateKeystoreFile(alfrescoConfiguration.getTomcatSSLKeystore());
sslHostConfigCertificate.setCertificateKeystorePassword(alfrescoConfiguration.getTomcatSSLKeystorePassword());
sslHostConfigCertificate.setCertificateKeystoreType("JCEKS");

sslHostConfig.addCertificate(sslHostConfigCertificate);
sslHostConfig.setTruststoreFile(alfrescoConfiguration.getTomcatSSLTruststore());
sslHostConfig.setTruststorePassword(alfrescoConfiguration.getTomcatSSLTruststorePassword());
sslHostConfig.setTruststoreType("JCEKS");
Expand Down
6 changes: 6 additions & 0 deletions tomcat-base/tomcat-embedded-10/overload.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,10 @@ ext {
tomcat = [
version: '10.1.23'
]
}

sonarqube {
properties {
property 'sonar.projectBaseDir', "$project.parent.projectDir/src/shared/"
}
}

0 comments on commit 7523658

Please sign in to comment.