You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "exceptionfactory (via GitHub)" <gi...@apache.org> on 2023/08/26 17:10:03 UTC
[GitHub] [nifi] exceptionfactory opened a new pull request, #7651: NIFI-12001 Refactor CertificateUtils to separate modules
exceptionfactory opened a new pull request, #7651:
URL: https://github.com/apache/nifi/pull/7651
# Summary
[NIFI-12001](https://issues.apache.org/jira/browse/NIFI-12001) Refactors the `CertificateUtils` class into discrete modules and components for improved dependency management and testing.
The new `nifi-security-cert` module includes utilities for reading Subject Alternative Names and deriving TLS peer identities from certificates. These components use standard Java classes and do not require any additional dependencies, making this module more portable for framework and extension integration.
The new `nifi-security-cert-builder` module depends on the Bouncy Castle Provider and PKIX libraries for generating X.509 certificates. The Bouncy Castle Provider is over 8 MB at the time of this writing. This separation from other certificate utilities provides the groundwork for subsequent efforts to refactor Key Store generation, which requires certificate generation.
Refactored changes include simplifying the certificate generation methods, which no longer require reordering distinguished names. The standard Java `X500Principal` class provides a contract for subject and issuer distinguished names, and the Bouncy Castle `RFC4519Style` class avoids the need to reverse distinguished name elements. The `StandardCertificateBuilder` provides a simplified constructor for self-signed certificates. The builder also includes methods for setting Subject DN and Subject Public Key properties to support certificates issued from a Certificate Authority.
Several test classes for the TLS toolkit included references to the Bouncy Castle Provider, which are not necessary on Java 8 and following given the availability of standard algorithms and key sizes.
# Tracking
Please complete the following tracking steps prior to pull request creation.
### Issue Tracking
- [X] [Apache NiFi Jira](https://issues.apache.org/jira/browse/NIFI) issue created
### Pull Request Tracking
- [X] Pull Request title starts with Apache NiFi Jira issue number, such as `NIFI-00000`
- [X] Pull Request commit message starts with Apache NiFi Jira issue number, as such `NIFI-00000`
### Pull Request Formatting
- [X] Pull Request based on current revision of the `main` branch
- [X] Pull Request refers to a feature branch with one commit containing changes
# Verification
Please indicate the verification steps performed prior to pull request creation.
### Build
- [X] Build completed using `mvn clean install -P contrib-check`
- [X] JDK 17
### Licensing
- [ ] New dependencies are compatible with the [Apache License 2.0](https://apache.org/licenses/LICENSE-2.0) according to the [License Policy](https://www.apache.org/legal/resolved.html)
- [ ] New dependencies are documented in applicable `LICENSE` and `NOTICE` files
### Documentation
- [ ] Documentation formatting appears as expected in rendered files
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nifi] mattyb149 commented on a diff in pull request #7651: NIFI-12001 Refactor CertificateUtils to separate modules
Posted by "mattyb149 (via GitHub)" <gi...@apache.org>.
mattyb149 commented on code in PR #7651:
URL: https://github.com/apache/nifi/pull/7651#discussion_r1307909950
##########
nifi-commons/nifi-socket-utils/src/main/java/org/apache/nifi/io/socket/SocketUtils.java:
##########
@@ -185,4 +187,23 @@ public static void closeQuietly(final ServerSocket serverSocket) {
}
}
+ /**
+ * Returns {@code true} if this exception is due to a TLS problem (either directly or because of its cause, if present). Traverses the cause chain recursively.
+ *
+ * @param e the exception to evaluate
+ * @return true if the direct or indirect cause of this exception was TLS-related
+ */
+ public static boolean isTlsError(Throwable e) {
Review Comment:
This would make a good generic utility method for getting to the root cause of an issue. Could be done as a follow-on Jira though.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nifi] mattyb149 closed pull request #7651: NIFI-12001 Refactor CertificateUtils to separate modules
Posted by "mattyb149 (via GitHub)" <gi...@apache.org>.
mattyb149 closed pull request #7651: NIFI-12001 Refactor CertificateUtils to separate modules
URL: https://github.com/apache/nifi/pull/7651
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nifi] mattyb149 commented on pull request #7651: NIFI-12001 Refactor CertificateUtils to separate modules
Posted by "mattyb149 (via GitHub)" <gi...@apache.org>.
mattyb149 commented on PR #7651:
URL: https://github.com/apache/nifi/pull/7651#issuecomment-1699696616
+1 LGTM, merging to support/nifi-1.x and main
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org