You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2019/10/14 06:51:31 UTC

[camel] branch camel-2.x updated (fe320c6 -> 280b386)

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a change to branch camel-2.x
in repository https://gitbox.apache.org/repos/asf/camel.git.


    from fe320c6  Regen
     new bc96705  [CAMEL-14023] Camel-salesforce-maven-plugin generate fails on IBM jdk (#3225)
     new 280b386  Fixed CS

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../component/salesforce/SalesforceComponent.java  |  3 ++
 .../salesforce/api/utils/SecurityUtils.java}       | 33 +++++++++++-----------
 .../apache/camel/maven/AbstractSalesforceMojo.java |  3 ++
 3 files changed, 22 insertions(+), 17 deletions(-)
 copy components/{camel-hdfs/src/test/java/org/apache/camel/component/hdfs/HdfsTestSupport.java => camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/SecurityUtils.java} (50%)


[camel] 02/02: Fixed CS

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch camel-2.x
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 280b386ed33dc982e44bbdc783da7cb8ce6e7659
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Mon Oct 14 08:49:17 2019 +0200

    Fixed CS
---
 .../camel/component/salesforce/api/utils/SecurityUtils.java       | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/SecurityUtils.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/SecurityUtils.java
index 5a449e5..936e323 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/SecurityUtils.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/SecurityUtils.java
@@ -14,14 +14,16 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.camel.component.salesforce.api.utils;
 
+import java.util.Arrays;
+
 import org.eclipse.jetty.util.ssl.SslContextFactory;
 
-import java.util.Arrays;
+public final class SecurityUtils {
 
-public class SecurityUtils {
+    private SecurityUtils() {
+    }
 
     public static void adaptToIBMCipherNames(final SslContextFactory sslContextFactory) {
         //jetty client adds into excluded cipher suites all ciphers starting with SSL_


[camel] 01/02: [CAMEL-14023] Camel-salesforce-maven-plugin generate fails on IBM jdk (#3225)

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch camel-2.x
in repository https://gitbox.apache.org/repos/asf/camel.git

commit bc96705418e85b8dd95336afd7d43ca3e98ef1cd
Author: JiriOndrusek <jo...@redhat.com>
AuthorDate: Mon Oct 14 08:47:04 2019 +0200

    [CAMEL-14023] Camel-salesforce-maven-plugin generate fails on IBM jdk (#3225)
---
 .../component/salesforce/SalesforceComponent.java  |  3 ++
 .../salesforce/api/utils/SecurityUtils.java        | 37 ++++++++++++++++++++++
 .../apache/camel/maven/AbstractSalesforceMojo.java |  3 ++
 3 files changed, 43 insertions(+)

diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceComponent.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceComponent.java
index 7ef163c..e43d13b 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceComponent.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceComponent.java
@@ -34,6 +34,7 @@ import org.apache.camel.VerifiableComponent;
 import org.apache.camel.component.extension.ComponentVerifierExtension;
 import org.apache.camel.component.salesforce.api.SalesforceException;
 import org.apache.camel.component.salesforce.api.dto.AbstractSObjectBase;
+import org.apache.camel.component.salesforce.api.utils.SecurityUtils;
 import org.apache.camel.component.salesforce.internal.OperationName;
 import org.apache.camel.component.salesforce.internal.PayloadFormat;
 import org.apache.camel.component.salesforce.internal.SalesforceSession;
@@ -739,6 +740,8 @@ public class SalesforceComponent extends DefaultComponent implements VerifiableC
     }
 
     static SalesforceHttpClient createHttpClient(final SslContextFactory sslContextFactory) throws Exception {
+        SecurityUtils.adaptToIBMCipherNames(sslContextFactory);
+
         final SalesforceHttpClient httpClient = new SalesforceHttpClient(sslContextFactory);
         // default settings, use httpClientProperties to set other
         // properties
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/SecurityUtils.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/SecurityUtils.java
new file mode 100644
index 0000000..5a449e5
--- /dev/null
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/SecurityUtils.java
@@ -0,0 +1,37 @@
+/**
+ * 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.salesforce.api.utils;
+
+import org.eclipse.jetty.util.ssl.SslContextFactory;
+
+import java.util.Arrays;
+
+public class SecurityUtils {
+
+    public static void adaptToIBMCipherNames(final SslContextFactory sslContextFactory) {
+        //jetty client adds into excluded cipher suites all ciphers starting with SSL_
+        //it makes sense for Oracle jdk, but in IBM jdk all ciphers starts with SSL_, even ciphers for TLS
+        //see https://github.com/eclipse/jetty.project/issues/2921
+        if (System.getProperty("java.vendor").contains("IBM")) {
+            String[] excludedCiphersWithoutSSLExclusion = Arrays.stream(sslContextFactory.getExcludeCipherSuites())
+                    .filter(cipher -> !cipher.equals("^SSL_.*$"))
+                    .toArray(String[]::new);
+            sslContextFactory.setExcludeCipherSuites(excludedCiphersWithoutSSLExclusion);
+        }
+    }
+}
diff --git a/components/camel-salesforce/camel-salesforce-maven-plugin/src/main/java/org/apache/camel/maven/AbstractSalesforceMojo.java b/components/camel-salesforce/camel-salesforce-maven-plugin/src/main/java/org/apache/camel/maven/AbstractSalesforceMojo.java
index b84e0f4..32b153a 100644
--- a/components/camel-salesforce/camel-salesforce-maven-plugin/src/main/java/org/apache/camel/maven/AbstractSalesforceMojo.java
+++ b/components/camel-salesforce/camel-salesforce-maven-plugin/src/main/java/org/apache/camel/maven/AbstractSalesforceMojo.java
@@ -27,6 +27,7 @@ import org.apache.camel.component.salesforce.SalesforceEndpointConfig;
 import org.apache.camel.component.salesforce.SalesforceHttpClient;
 import org.apache.camel.component.salesforce.SalesforceLoginConfig;
 import org.apache.camel.component.salesforce.api.SalesforceException;
+import org.apache.camel.component.salesforce.api.utils.SecurityUtils;
 import org.apache.camel.component.salesforce.internal.PayloadFormat;
 import org.apache.camel.component.salesforce.internal.SalesforceSession;
 import org.apache.camel.component.salesforce.internal.client.DefaultRestClient;
@@ -227,6 +228,8 @@ abstract class AbstractSalesforceMojo extends AbstractMojo {
             final SslContextFactory sslContextFactory = new SslContextFactory();
             sslContextFactory.setSslContext(sslContextParameters.createSSLContext(new DefaultCamelContext()));
 
+            SecurityUtils.adaptToIBMCipherNames(sslContextFactory);
+
             httpClient = new SalesforceHttpClient(sslContextFactory);
         } catch (final GeneralSecurityException e) {
             throw new MojoExecutionException("Error creating default SSL context: " + e.getMessage(), e);