-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
XENOPS-1201 Dropped Alfresco 5 and 6; Added Alfresco 7.1, 7.2, 7.3, 7…
….4; Dropped secret in favor of TLS; Dropped obsolete Jar shadowing; Dropped obsolete boms; Fixed log4j2 bug (limited to docker compose and minimal log4j2.properties config; Fixed bug in integration test where files used for testing were no longer available;
- Loading branch information
1 parent
61c604a
commit 66a1f13
Showing
20 changed files
with
235 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
...-platform/src/main/amp/config/alfresco/module/alfresco-health-processor/log4j2.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
logger.eu_xenit_alfresco_healthprocessor.name=eu.xenit.alfresco.healthprocessor | ||
logger.eu_xenit_alfresco_healthprocessor.level=info | ||
logger.eu_xenit_alfresco_healthprocessor_indexing.name=eu.xenit.alfresco.healthprocessor.indexing | ||
logger.eu_xenit_alfresco_healthprocessor_fixer.name=eu.xenit.alfresco.healthprocessor.fixer | ||
logger.eu_xenit_alfresco_healthprocessor_plugins.name=eu.xenit.alfresco.healthprocessor.plugins | ||
logger.eu_xenit_alfresco_healthprocessor_processing.name=eu.xenit.alfresco.healthprocessor.processing | ||
logger.eu_xenit_alfresco_healthprocessor_reporter.name=eu.xenit.alfresco.healthprocessor.reporter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
...rm/src/main/java/eu/xenit/alfresco/healthprocessor/plugins/solr/SslHttpClientFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
package eu.xenit.alfresco.healthprocessor.plugins.solr; | ||
|
||
import org.apache.http.client.HttpClient; | ||
import org.apache.http.conn.ssl.NoopHostnameVerifier; | ||
import org.apache.http.conn.ssl.SSLConnectionSocketFactory; | ||
import org.apache.http.impl.client.HttpClientBuilder; | ||
import org.apache.http.ssl.SSLContexts; | ||
|
||
import java.io.File; | ||
import java.io.FileInputStream; | ||
import java.io.IOException; | ||
import java.security.KeyManagementException; | ||
import java.security.KeyStore; | ||
import java.security.KeyStoreException; | ||
import java.security.NoSuchAlgorithmException; | ||
import java.security.UnrecoverableKeyException; | ||
import java.security.cert.CertificateException; | ||
import java.util.Objects; | ||
import java.util.Properties; | ||
|
||
public class SslHttpClientFactory { | ||
|
||
public static HttpClient setupHttpClient(Properties globalProperties) { | ||
try { | ||
String keystoreLocation = globalProperties.getProperty("encryption.ssl.keystore.location"); | ||
String truststoreLocation = globalProperties.getProperty("encryption.ssl.truststore.location"); | ||
|
||
File keystoreParentLocation = new File(keystoreLocation).getParentFile(); | ||
String keystorePassword = Objects.toString(getKeystorePassword(keystoreParentLocation)); | ||
|
||
// Load the KeyStore | ||
KeyStore keyStore = KeyStore.getInstance("JCEKS"); | ||
try (FileInputStream keystoreFile = new FileInputStream(keystoreLocation)) { | ||
keyStore.load(keystoreFile, keystorePassword.toCharArray()); | ||
} | ||
|
||
// Load the TrustStore | ||
String truststorePassword = Objects.toString(getTruststorePassword(keystoreParentLocation)); | ||
KeyStore trustStore = KeyStore.getInstance("JCEKS"); | ||
try (FileInputStream truststoreFile = new FileInputStream(truststoreLocation)) { | ||
trustStore.load(truststoreFile, truststorePassword.toCharArray()); | ||
} | ||
|
||
// Build SSLContext | ||
// If the key password is different from the keystore password, | ||
// retrieve it similarly if specified (else assume same) | ||
char[] keyPasswordChars = keystorePassword.toCharArray(); | ||
|
||
javax.net.ssl.SSLContext sslContext = SSLContexts.custom() | ||
.loadKeyMaterial(keyStore, keyPasswordChars) | ||
.loadTrustMaterial(trustStore, (chain, authType) -> true) // Use default trust strategy | ||
.build(); | ||
|
||
// Create the SSLConnectionSocketFactory with the SSLContext | ||
SSLConnectionSocketFactory sslSocketFactory = new SSLConnectionSocketFactory( | ||
sslContext, | ||
new String[]{"TLSv1.2","TLSv1.3"}, // Allowed TLS protocols | ||
null, // Default cipher suites | ||
NoopHostnameVerifier.INSTANCE | ||
); | ||
return HttpClientBuilder.create() | ||
.setSSLHostnameVerifier(NoopHostnameVerifier.INSTANCE) | ||
.setSSLSocketFactory(sslSocketFactory) | ||
.build(); | ||
} catch (IOException | CertificateException | KeyManagementException | UnrecoverableKeyException | | ||
KeyStoreException | NoSuchAlgorithmException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
|
||
private static Object getKeystorePassword(File keystoreParentLocation) throws IOException { | ||
Properties p = new Properties(); | ||
p.load(new FileInputStream(keystoreParentLocation.getAbsolutePath() | ||
+ "/ssl-keystore-passwords.properties")); | ||
return p.get("keystore.password"); | ||
} | ||
|
||
private static Object getTruststorePassword(File keystoreParentLocation) throws IOException { | ||
Properties p = new Properties(); | ||
p.load(new FileInputStream(keystoreParentLocation.getAbsolutePath() | ||
+ "/ssl-truststore-passwords.properties")); | ||
return p.get("keystore.password"); | ||
} | ||
} |
25 changes: 13 additions & 12 deletions
25
...src/test/java/eu/xenit/alfresco/healthprocessor/plugins/solr/SolrRequestExecutorTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
reckon.scope=patch | ||
reckon.scope=patch | ||
alfrescoVersion=7.1.0 | ||
alfredTelemetryVersion=0.10.1 | ||
micrometerVersion=1.0.6 | ||
jvmExtrasVersion=0.1.2 | ||
lombokVersion=1.18.36 | ||
ootbVersion=1.2.2.0 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.