Github user olegz commented on a diff in the pull request:
https://github.com/apache/nifi/pull/1530#discussion_r103752061
--- Diff:
nifi-toolkit/nifi-toolkit-tls/src/main/java/org/apache/nifi/toolkit/tls/util/TlsHelper.java
---
@@ -215,4 +210,17 @@ public static JcaPKCS10CertificationRequest
generateCertificationRequest(String
JcaContentSignerBuilder jcaContentSignerBuilder = new
JcaContentSignerBuilder(signingAlgorithm);
return new
JcaPKCS10CertificationRequest(jcaPKCS10CertificationRequestBuilder.build(jcaContentSignerBuilder.build(keyPair.getPrivate())));
}
+
+ public static Extensions createDomainAlternativeNamesExtensions(String
domainAlternativeNames) throws IOException {
+ List<GeneralName> namesList = new ArrayList<>();
+ for(String alternativeName : domainAlternativeNames.split(",")) {
+ namesList.add(new GeneralName(GeneralName.dNSName,
alternativeName));
+ }
+
--- End diff --
Since we're on Java 8 may be we should start embracing it a bit more, at
least for simple things like the above
```
List<GeneralName> namesList = Stream.of(domainAlternativeNames.split(","))
.map(alternativeName -> new
GeneralName(GeneralName.dNSName, alternativeName))
.collect(Collectors.toList());
```
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---