[
https://issues.apache.org/jira/browse/NIFI-5161?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16466269#comment-16466269
]
ASF GitHub Bot commented on NIFI-5161:
--------------------------------------
Github user alopresto commented on a diff in the pull request:
https://github.com/apache/nifi/pull/2684#discussion_r186503174
--- Diff:
nifi-toolkit/nifi-toolkit-tls/src/main/java/org/apache/nifi/toolkit/tls/standalone/TlsToolkitStandalone.java
---
@@ -236,6 +236,6 @@ public void
createNifiKeystoresAndTrustStores(StandaloneConfig standaloneConfig)
}
protected static String getClientDnFile(String clientDn) {
- return clientDn.replace(',', '_').replace(' ', '_');
+ return clientDn.replace(',', '_').replace(' ',
'_').replaceAll("[^\\w&&[^\\.]&&[^=]]", "_");
--- End diff --
Since the regular expression is being used in multiple places, I would
recommend making this a `public static final` constant in one of the toolkit
utility classes.
> Toolkit character escaping issue
> --------------------------------
>
> Key: NIFI-5161
> URL: https://issues.apache.org/jira/browse/NIFI-5161
> Project: Apache NiFi
> Issue Type: Bug
> Components: Tools and Build
> Reporter: Matt Gilman
> Assignee: Nathan Gough
> Priority: Minor
>
> The Java Keystore does not perform any character validation on the alias
> field, so theoretically a "/" character should be accepted. According to the
> Java documentation, the only instruction is "Whether aliases are case
> sensitive is implementation dependent. In order to avoid problems, it is
> recommended not to use aliases in a KeyStore that only differ in case."
> The toolkit will need to be updated to correctly escape special characters
> when passing them to the Java commands.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)