SLING-10837 - The KEYS file should be retrieved from the correct location
* corrected URL from which the KEYS file is retrieved
diff --git a/src/main/java/org/apache/sling/cli/impl/pgp/PGPSignatureValidator.java b/src/main/java/org/apache/sling/cli/impl/pgp/PGPSignatureValidator.java
index d813061..4a2c902 100644
--- a/src/main/java/org/apache/sling/cli/impl/pgp/PGPSignatureValidator.java
+++ b/src/main/java/org/apache/sling/cli/impl/pgp/PGPSignatureValidator.java
@@ -55,6 +55,8 @@
@Component(service = PGPSignatureValidator.class)
public class PGPSignatureValidator {
+ private static final String KEYS_FILE_URL = "https://downloads.apache.org/sling/KEYS";
+
@Reference
private HttpClientFactory httpClientFactory;
@@ -94,7 +96,7 @@
if (Files.notExists(keysFilePath)) {
try {
try (CloseableHttpClient client = httpClientFactory.newClient()) {
- HttpGet get = new HttpGet("https://people.apache.org/keys/group/sling.asc");
+ HttpGet get = new HttpGet(KEYS_FILE_URL);
try (CloseableHttpResponse response = client.execute(get)) {
try (InputStream content = response.getEntity().getContent()) {
IOUtils.copy(content, new FileOutputStream(keysFilePath.toFile()));
@@ -103,7 +105,7 @@
}
} catch (IOException e) {
throw new IllegalStateException(
- "Cannot download Sling key file from https://people.apache.org/keys/group/sling.asc", e);
+ "Cannot download Sling key file from " + KEYS_FILE_URL, e);
}
}
try (InputStream in = Files.newInputStream(keysFilePath)) {