[ 
https://issues.apache.org/jira/browse/NIFI-3490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15890732#comment-15890732
 ] 

ASF GitHub Bot commented on NIFI-3490:
--------------------------------------

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());
    ```


> TLS Toolkit - define SAN in standalone mode
> -------------------------------------------
>
>                 Key: NIFI-3490
>                 URL: https://issues.apache.org/jira/browse/NIFI-3490
>             Project: Apache NiFi
>          Issue Type: Improvement
>          Components: Tools and Build
>            Reporter: Pierre Villard
>            Assignee: Pierre Villard
>            Priority: Minor
>              Labels: tls-toolkit
>             Fix For: 1.2.0
>
>
> Following NIFI-3331, it would be useful to have the same option (add Subject 
> Alternative Names in certificates) when using the TLS toolkit in standalone 
> mode.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to