You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "christophd (via GitHub)" <gi...@apache.org> on 2024/10/23 12:53:31 UTC
[PR] CAMEL-21358: Add Knative Http SSL client options [camel]
christophd opened a new pull request, #16064:
URL: https://github.com/apache/camel/pull/16064
# Description
- Provide Http client options to easily connect with SSL secured Knative broker
- Support keystore and truststore in different formats (jks, p12, pem)
- Support multiple key and trust certificates
- Support autoconfiguration of client options via system property and environment variable property binding
- Support bean lookup of client options via Camel context
- Improve Knative component docs
- Add Knative Http transport docs
<!--
- Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
-->
# Target
- [x] I checked that the commit is targeting the correct branch (note that Camel 3 uses `camel-3.x`, whereas Camel 4 uses the `main` branch)
# Tracking
- [x] If this is a large change, bug fix, or code improvement, I checked there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it).
See CAMEL-21358
<!--
# *Note*: trivial changes like, typos, minor documentation fixes and other small items do not require a JIRA issue. In this case your pull request should address just this issue, without pulling in other changes.
-->
# Apache Camel coding standards and style
- [x] I checked that each commit in the pull request has a meaningful subject line and body.
<!--
If you're unsure, you can format the pull request title like `[CAMEL-XXX] Fixes bug in camel-file component`, where you replace `CAMEL-XXX` with the appropriate JIRA issue.
-->
- [x] I have run `mvn clean install -DskipTests` locally from root folder and I have committed all auto-generated changes.
<!--
You can run the aforementioned command in your module so that the build auto-formats your code. This will also be verified as part of the checks and your PR may be rejected if if there are uncommited changes after running `mvn clean install -DskipTests`.
You can learn more about the contribution guidelines at https://github.com/apache/camel/blob/main/CONTRIBUTING.md
-->
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-21358: Add Knative Http SSL client options [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #16064:
URL: https://github.com/apache/camel/pull/16064#issuecomment-2432059681
:star2: Thank you for your contribution to the Apache Camel project! :star2:
:robot: CI automation will test this PR automatically.
:camel: Apache Camel Committers, please review the following items:
* First-time contributors **require MANUAL approval** for the GitHub Actions to run
* You can use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot.
* You can label PRs using `build-all`, `build-dependents`, `skip-tests` and `test-dependents` to fine-tune the checks executed by this PR.
* Build and test logs are available in the Summary page. **Only** [Apache Camel committers](https://camel.apache.org/community/team/#committers) have access to the summary.
* :warning: Be careful when sharing logs. Review their contents before sharing them publicly.
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-21358: Add Knative Http SSL client options [camel]
Posted by "christophd (via GitHub)" <gi...@apache.org>.
christophd merged PR #16064:
URL: https://github.com/apache/camel/pull/16064
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-21358: Add Knative Http SSL client options [camel]
Posted by "christophd (via GitHub)" <gi...@apache.org>.
christophd commented on code in PR #16064:
URL: https://github.com/apache/camel/pull/16064#discussion_r1813131948
##########
components/camel-knative/camel-knative-component/src/main/docs/knative-component.adoc:
##########
@@ -137,13 +137,21 @@ RouteBuilder.addRoutes(context, b -> {
<1> set the location of the `Knative Environment` file
<2> expose knative service
-=== Using custom Knative Transport
+You can also use property based component configuration to set the `Knative Environemnt` configuration file.
Review Comment:
ups, nice catch!
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-21358: Add Knative Http SSL client options [camel]
Posted by "christophd (via GitHub)" <gi...@apache.org>.
christophd commented on code in PR #16064:
URL: https://github.com/apache/camel/pull/16064#discussion_r1813135993
##########
components/camel-knative/camel-knative-component/src/main/docs/knative-component.adoc:
##########
@@ -137,13 +137,21 @@ RouteBuilder.addRoutes(context, b -> {
<1> set the location of the `Knative Environment` file
<2> expose knative service
-=== Using custom Knative Transport
+You can also use property based component configuration to set the `Knative Environemnt` configuration file.
-As today the component only support `http` as transport as it is the only supported protocol on Knative side but the transport is pluggable by implementing the following interface:
+.application.properties
+[source,properties]
+----
+camel.component.knative.environmentPath=classpath:knative.json
Review Comment:
no, this is not a new behavior and it is also working with `CAMEL_COMPONENT_KNATIVE_ENVIRONMENT_PATH` envVar
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-21358: Add Knative Http SSL client options [camel]
Posted by "christophd (via GitHub)" <gi...@apache.org>.
christophd commented on code in PR #16064:
URL: https://github.com/apache/camel/pull/16064#discussion_r1813129125
##########
components/camel-knative/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/TrustAllOptions.java:
##########
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.knative.http;
+
+import java.security.KeyStore;
+import java.security.Provider;
+import java.security.cert.X509Certificate;
+import java.util.function.Function;
+
+import javax.net.ssl.ManagerFactoryParameters;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.TrustManagerFactory;
+import javax.net.ssl.TrustManagerFactorySpi;
+import javax.net.ssl.X509TrustManager;
+
+import io.vertx.core.Vertx;
+import io.vertx.core.net.TrustOptions;
+
+/**
+ * Trust options for trusting all client and server certificates. Do not use in production environments but primarily in
+ * test environments. Implementation is heavily based on the Quarkus TLS registry implementation.
Review Comment:
It is runtime agnostic and works also on main or SpringBoot. The implementation is just heavily inspired from Quarkus
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-21358: Add Knative Http SSL client options [camel]
Posted by "squakez (via GitHub)" <gi...@apache.org>.
squakez commented on code in PR #16064:
URL: https://github.com/apache/camel/pull/16064#discussion_r1813070646
##########
components/camel-knative/camel-knative-component/src/main/docs/knative-component.adoc:
##########
@@ -137,13 +137,21 @@ RouteBuilder.addRoutes(context, b -> {
<1> set the location of the `Knative Environment` file
<2> expose knative service
-=== Using custom Knative Transport
+You can also use property based component configuration to set the `Knative Environemnt` configuration file.
-As today the component only support `http` as transport as it is the only supported protocol on Knative side but the transport is pluggable by implementing the following interface:
+.application.properties
+[source,properties]
+----
+camel.component.knative.environmentPath=classpath:knative.json
Review Comment:
Is this anyhow changing any previous behavior. I am not into details of the implementations, just wondering if by any chance we'll be introducing any breaking compatibility. I recall we gave the possibility to initialize environment from an environment variable as well, but I may be making confusion.
##########
components/camel-knative/camel-knative-component/src/main/docs/knative-component.adoc:
##########
@@ -137,13 +137,21 @@ RouteBuilder.addRoutes(context, b -> {
<1> set the location of the `Knative Environment` file
<2> expose knative service
-=== Using custom Knative Transport
+You can also use property based component configuration to set the `Knative Environemnt` configuration file.
Review Comment:
```suggestion
You can also use property based component configuration to set the `Knative Environment` configuration file.
```
##########
components/camel-knative/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/TrustAllOptions.java:
##########
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.knative.http;
+
+import java.security.KeyStore;
+import java.security.Provider;
+import java.security.cert.X509Certificate;
+import java.util.function.Function;
+
+import javax.net.ssl.ManagerFactoryParameters;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.TrustManagerFactory;
+import javax.net.ssl.TrustManagerFactorySpi;
+import javax.net.ssl.X509TrustManager;
+
+import io.vertx.core.Vertx;
+import io.vertx.core.net.TrustOptions;
+
+/**
+ * Trust options for trusting all client and server certificates. Do not use in production environments but primarily in
+ * test environments. Implementation is heavily based on the Quarkus TLS registry implementation.
Review Comment:
How would this behave on main or Spring Boot runtimes?
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org