Polishing.
Correctly propagate certificate format. See gh-688
This commit is contained in:
@@ -181,6 +181,15 @@ public class VaultPkiTemplate implements VaultPkiOperations {
|
||||
if (certificateRequest.isExcludeCommonNameFromSubjectAltNames()) {
|
||||
request.put("exclude_cn_from_sans", true);
|
||||
}
|
||||
|
||||
if (StringUtils.hasText(certificateRequest.getFormat())) {
|
||||
request.put("format", certificateRequest.getFormat());
|
||||
}
|
||||
|
||||
if (StringUtils.hasText(certificateRequest.getPrivateKeyFormat())) {
|
||||
request.put("private_key_format", certificateRequest.getPrivateKeyFormat());
|
||||
}
|
||||
|
||||
return request;
|
||||
}
|
||||
|
||||
|
||||
@@ -159,7 +159,9 @@ class VaultPkiTemplateIntegrationTests extends IntegrationTestSupport {
|
||||
void issueCertificateUsingFormat(KeyFixture keyFixture) throws Exception {
|
||||
|
||||
VaultCertificateRequest request = VaultCertificateRequest.builder()
|
||||
.commonName(keyFixture.format.replace('_', '-') + ".hello.example.com").format(keyFixture.format)
|
||||
.commonName(keyFixture.format.replace('_', '-') + ".hello.example.com")
|
||||
.privateKeyFormat(keyFixture.privateKeyFormat)
|
||||
.format(keyFixture.format)
|
||||
.build();
|
||||
|
||||
VaultCertificateResponse certificateResponse = this.pkiOperations
|
||||
|
||||
Reference in New Issue
Block a user