Skip to content

Commit 93da1a6

Browse files
committed
Fix: private keys not retrieved from keystore
1 parent f021360 commit 93da1a6

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

CHANGELOG.adoc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,17 @@ ifdef::env-github[]
99
:warning-caption: :warning:
1010
endif::[]
1111

12+
== Version 0.4.3
13+
[cols="1,2,<10a", options="header"]
14+
|===
15+
|ID|Type|Description
16+
|0
17+
|Fix
18+
|Due to a bug private keys are not retrieved from a keystore.
19+
This is fixed now.
20+
|===
21+
22+
1223
== Version 0.4.2
1324
[cols="1,2,<10a", options="header"]
1425
|===

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<modelVersion>4.0.0</modelVersion>
2020
<groupId>com.github.axway-api-management-plus</groupId>
2121
<artifactId>yamles-utils</artifactId>
22-
<version>0.4.2</version>
22+
<version>0.4.3</version>
2323
<packaging>jar</packaging>
2424
<name>YAML Entity Store Utilities</name>
2525
<description>Utilities for YAML Entity Store based API Gateway projects.</description>

src/main/java/com/axway/yamles/utils/spi/impl/KeystoreCertificateProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public CertificateReplacement getCertificate(File configSource, String aliasName
130130
boolean nokey = getConfig(CFG_NOKEY, config, "false").equals("true");
131131
Key key = ks.getKey(aliasName, password);
132132
log.debug("key for alias '{}' {}found", aliasName, (key == null) ? "not " : "");
133-
if (!nokey && key != null) {
133+
if (key != null && nokey) {
134134
key = null;
135135
log.debug("key for alias '{}' suppressed", aliasName);
136136
}

src/test/java/com/axway/yamles/utils/spi/impl/KeystoreCertificateProviderTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ void testKeystoreFromData() throws Exception {
4848

4949
assertEquals("server", cr.getAlias());
5050
assertTrue(cr.getCert().isPresent());
51+
assertTrue(cr.getKey().isPresent());
5152
}
5253

5354
@Test
@@ -65,5 +66,6 @@ void testKeystoreFromPath() throws Exception {
6566

6667
assertEquals("server", cr.getAlias());
6768
assertTrue(cr.getCert().isPresent());
69+
assertTrue(cr.getKey().isPresent());
6870
}
6971
}

0 commit comments

Comments
 (0)